Advertisement
calebbfmv

KickOP

Aug 5th, 2012
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.calebbfmv.StopAskingOp;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.configuration.file.FileConfiguration;
  6. import org.bukkit.event.EventHandler;
  7. import org.bukkit.event.Listener;
  8. import org.bukkit.event.player.PlayerChatEvent;
  9. import org.bukkit.permissions.Permission;
  10. import org.bukkit.plugin.PluginDescriptionFile;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12.  
  13.  
  14.  
  15. public class StopOP extends JavaPlugin implements Listener {
  16. public Logger log = Logger.getLogger("Minecraft");
  17. public FileConfiguration config;
  18. public Permission enablePermission = new Permission ("KickOP.enable");
  19.  
  20. public void onEnable() {
  21. config = this.getConfig();
  22. config.options().copyDefaults();
  23. this.saveConfig();
  24. PluginDescriptionFile pdffile = this.getDescription();
  25. log.info(pdffile.getName() + " " + pdffile.getVersion() + " enabled Kick Op by calebbfmv");
  26. getServer().getPluginManager().registerEvents(this, this);
  27. }
  28.  
  29.  
  30. public void onDisable() {
  31. PluginDescriptionFile pdffile = this.getDescription();
  32. log.info(pdffile.getName() + " " + pdffile.getVersion() + " is now disabled.");
  33. }
  34. @EventHandler
  35. public void onPlayerChat(PlayerChatEvent event){
  36. String msg = event.getMessage().toLowerCase();
  37. if(msg.contains("can i be" + getConfig().getStringList("groups"))) {
  38. event.getPlayer().kickPlayer(getConfig().getString("kickmsg"));
  39.  
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement