Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.calebbfmv.StopAskingOp;
- import java.util.logging.Logger;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.PlayerChatEvent;
- import org.bukkit.permissions.Permission;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- public class StopOP extends JavaPlugin implements Listener {
- public Logger log = Logger.getLogger("Minecraft");
- public FileConfiguration config;
- public Permission enablePermission = new Permission ("KickOP.enable");
- public void onEnable() {
- config = this.getConfig();
- config.options().copyDefaults();
- this.saveConfig();
- PluginDescriptionFile pdffile = this.getDescription();
- log.info(pdffile.getName() + " " + pdffile.getVersion() + " enabled Kick Op by calebbfmv");
- getServer().getPluginManager().registerEvents(this, this);
- }
- public void onDisable() {
- PluginDescriptionFile pdffile = this.getDescription();
- log.info(pdffile.getName() + " " + pdffile.getVersion() + " is now disabled.");
- }
- @EventHandler
- public void onPlayerChat(PlayerChatEvent event){
- String msg = event.getMessage().toLowerCase();
- if(msg.contains("can i be" + getConfig().getStringList("groups"))) {
- event.getPlayer().kickPlayer(getConfig().getString("kickmsg"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement