package me.josiah.onduty;  import java.util.logging.Logger;   import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.event.Listener; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin;   public class onduty extends JavaPlugin implements Listener{ 	public Logger logger = Logger.getLogger("Minecraft"); 	 	@Override 	public void onDisable(){ 		PluginDescriptionFile pdfFile = this.getDescription(); 		this.logger.info(pdfFile.getName() +" "+ "Has been Disabled!"); 	} 	 	@Override 	public void onEnable(){ 		PluginDescriptionFile pdfFile = this.getDescription(); 		this.logger.info(pdfFile.getName() +" "+ "Version " +pdfFile.getVersion()+" "+ "Has been Enabled!"); 		getConfig().options().copyDefaults(true); 		saveConfig(); 	} 	 	public boolean onCommand(CommandSender sender,Command cmd,String commandLabel,String[] args){ 		Player player = (Player) sender; 		if(commandLabel.equalsIgnoreCase("onduty")) 			if(sender.hasPermission(new permissions().canuse)){ 			PlayerInventory pi = player.getInventory(); 			ItemStack boot = new ItemStack(Material.DIAMOND_BOOTS); 			ItemStack leg = new ItemStack(Material.DIAMOND_LEGGINGS); 			ItemStack chest = new ItemStack(Material.DIAMOND_CHESTPLATE); 			ItemStack helmet = new ItemStack(Material.DIAMOND_HELMET); 			ItemStack baton = new ItemStack(Material.STICK); 			boot.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10); 			leg.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10); 			chest.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10); 			helmet.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10); 			baton.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 10); 			baton.addUnsafeEnchantment(Enchantment.KNOCKBACK, 10); 			pi.setHelmet(helmet); 			pi.setChestplate(chest); 			pi.setLeggings(leg); 			pi.setBoots(boot); 			pi.addItem(baton); 			player.sendMessage(getConfig().getString("onduty").replaceAll("egr", ChatColor.GREEN + "").replaceAll 					("oyelo", ChatColor.YELLOW + "").replaceAll("ubl", ChatColor.BLUE + "").replaceAll("ogl", ChatColor.GOLD + "").replaceAll 					("dre", ChatColor.RED + "")); 			}else{ 				player.sendMessage(getConfig().getString("no permissions").replaceAll("egr", ChatColor.GREEN + "").replaceAll 						("oyelo", ChatColor.YELLOW + "").replaceAll("ubl", ChatColor.BLUE + "").replaceAll("ogl", ChatColor.GOLD + "").replaceAll 						("dre", ChatColor.RED + "")); 		}else if(commandLabel.equalsIgnoreCase("offduty")) 			if(sender.hasPermission(new permissions().canuse))  { 			PlayerInventory pi = player.getInventory(); 			ItemStack boot = new ItemStack(Material.AIR); 			ItemStack leg = new ItemStack(Material.AIR); 			ItemStack chest = new ItemStack(Material.AIR); 			ItemStack helmet = new ItemStack(Material.AIR); 			pi.setHelmet(helmet); 			pi.setChestplate(chest); 			pi.setLeggings(leg); 			pi.setBoots(boot); 			pi.remove(Material.STICK); 			player.sendMessage(getConfig().getString("offduty").replaceAll("egr", ChatColor.GREEN + "").replaceAll 					("oyelo", ChatColor.YELLOW + "").replaceAll("ubl", ChatColor.BLUE + "").replaceAll("ogl", ChatColor.GOLD + "").replaceAll 					("dre", ChatColor.RED + "")); 			}else{ 				player.sendMessage(getConfig().getString("no permissions").replaceAll("egr", ChatColor.GREEN + "").replaceAll 						("oyelo", ChatColor.YELLOW + "").replaceAll("ubl", ChatColor.BLUE + "").replaceAll("ogl", ChatColor.GOLD + "").replaceAll 						("dre", ChatColor.RED + "")); 	} 		return false; } }