PageRenderTime 1652ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/src/com/zachspong/NoSpeedKick/NoSpeedKick.java

https://bitbucket.org/zachman1221/nospeedkick
Java | 43 lines | 33 code | 10 blank | 0 comment | 1 complexity | 00c133d6050535ba808e87b7d45263c1 MD5 | raw file
  1. package com.zachspong.NoSpeedKick;
  2. import java.util.logging.Logger;
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.event.Event;
  7. import org.bukkit.plugin.PluginDescriptionFile;
  8. import org.bukkit.plugin.PluginManager;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10. import com.zachspong.NoSpeedKick.NKPlayerListener;
  11. public class NoSpeedKick extends JavaPlugin {
  12. private final NKPlayerListener playerListener = new NKPlayerListener(this);
  13. Logger log1 = Logger.getLogger("Minecraft");
  14. public final Logger logger = Logger.getLogger("Minecraft");
  15. public void onDisable() {
  16. PluginDescriptionFile pdFile = this.getDescription();
  17. this.logger.info(pdFile.getName() + " version " + pdFile.getVersion() + " is Disabled");
  18. }
  19. public void onEnable() {
  20. PluginManager pm = getServer().getPluginManager();
  21. PluginDescriptionFile pdFile = this.getDescription();
  22. this.logger.info(pdFile.getName() + " version " + pdFile.getVersion() + " is Disabled");
  23. pm.registerEvent(Event.Type.PLAYER_KICK, this.playerListener, Event.Priority.Normal, this);
  24. }
  25. public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args)
  26. {
  27. if(command.getName().toLowerCase().equals("nsk")||command.getName().toLowerCase().equals("nospeedkick")){
  28. PluginDescriptionFile pdFile = this.getDescription();
  29. sender.sendMessage(ChatColor.GOLD + "NoSpeedKick Version: " + pdFile.getVersion() + " By: " + pdFile.getAuthors());
  30. }
  31. return false;
  32. }
  33. }