}
@EventHandler(priority = EventPriority.HIGH)
public void onButtonClick(ButtonClickEvent event) {
SpoutPlayer player = event.getPlayer();
// **********fight**************
checkButtonClicked("Move. 1", 5, player, ConflictPlugin.skillFightSpeedLand, 1, "updateWalkSpeed", event);
checkButtonClicked("Jump", 5, player, ConflictPlugin.skillFightJump, 1, "updateJump", event);
// checkButtonClicked("Swim 1", 5, player, ConflictPlugin.skillFightSpeedWater, 1, "updateSwimSpeed", event);
// checkButtonClicked("Swim 2", 5, player, ConflictPlugin.skillFightSpeedWater, 2, "updateSwimSpeed", event);
checkButtonClicked("Move. 2", 10, player, ConflictPlugin.skillFightSpeedLand, 2, "updateWalkSpeed", event);
checkButtonClicked("Fight 1", 5, player, ConflictPlugin.skillFightMonsters, 1, null, event);
checkButtonClicked("Fight 2", 5, player, ConflictPlugin.skillFightMonsters, 2, null, event);
checkButtonClicked("Def. 1", 5, player, ConflictPlugin.skillFightArmor, 1, null, event);
checkButtonClicked("Dam. 1", 5, player, ConflictPlugin.skillFightDamage, 1, null, event);
checkButtonClicked("Regen. 1", 10, player, ConflictPlugin.skillFightRegeneration, 1, null, event);
checkButtonClicked("Camp 1", 10, player, ConflictPlugin.skillFightCamp, 1, "updateCampingTreshold", event);
checkButtonClicked("Ender", 10, player, ConflictPlugin.skillFightDrop, 1, null, event);
// **********craft*****************
checkButtonClicked("Durability 1", 4, player, ConflictPlugin.skillCraftQual, 1, null, event);
checkButtonClicked("Durability 2", 4, player, ConflictPlugin.skillCraftQual, 2, null, event);
checkButtonClicked("Bow 1", 5, player, ConflictPlugin.skillCraftBow, 1, null, event);
checkButtonClicked("Sword 1", 5, player, ConflictPlugin.skillCraftSword, 1, null, event);
checkButtonClicked("Armor 1", 5, player, ConflictPlugin.skillCraftArmor, 1, null, event);
checkButtonClicked("Tools 1", 5, player, ConflictPlugin.skillCraftTool, 1, null, event);
checkButtonClicked("Bow 2", 10, player, ConflictPlugin.skillCraftBow, 2, null, event);
checkButtonClicked("Sword 2", 10, player, ConflictPlugin.skillCraftSword, 2, null, event);
checkButtonClicked("Armor 2", 10, player, ConflictPlugin.skillCraftArmor, 2, null, event);
checkButtonClicked("Tools 2", 10, player, ConflictPlugin.skillCraftTool, 2, null, event);
// ***************MINE***************
checkButtonClicked("Durab 1", 5, player, ConflictPlugin.skillMineDurab, 1, null, event);
checkButtonClicked("Durab 2", 5, player, ConflictPlugin.skillMineDurab, 2, null, event);
checkButtonClicked("Clay 1", 5, player, ConflictPlugin.skillMineClay, 1, null, event);
checkButtonClicked("Lapis 1", 5, player, ConflictPlugin.skillMineLapis, 1, null, event);
checkButtonClicked("Iron 1", 5, player, ConflictPlugin.skillMineIron, 1, null, event);
// checkButtonClicked("Redstone 1", 5, player, ConflictPlugin.skillMineRedstone, 1, null, event);
checkButtonClicked("Gold 1", 5, player, ConflictPlugin.skillMineGold, 1, null, event);
checkButtonClicked("Diam. 1", 10, player, ConflictPlugin.skillMineDiamond, 1, null, event);
checkButtonClicked("Clay 2", 5, player, ConflictPlugin.skillMineClay, 2, null, event);
checkButtonClicked("Lapis 2", 5, player, ConflictPlugin.skillMineLapis, 2, null, event);
checkButtonClicked("Iron 2", 5, player, ConflictPlugin.skillMineIron, 2, null, event);
// checkButtonClicked("Redstone 1", 5, player, ConflictPlugin.skillMineRedstone, 1, null, event);
checkButtonClicked("Gold 2", 5, player, ConflictPlugin.skillMineGold, 2, null, event);
checkButtonClicked("Diam. 2", 10, player, ConflictPlugin.skillMineDiamond, 2, null, event);
checkButtonClicked("G3d 1", 5, player, ConflictPlugin.skillFoodSeed, 1, null, event);
checkButtonClicked("G3d 2", 5, player, ConflictPlugin.skillFoodHarvest, 1, null, event);
checkButtonClicked("G3d 3", 5, player, ConflictPlugin.skillFoodBone, 1, null, event);
checkButtonClicked("G3d 4", 5, player, ConflictPlugin.skillFoodSeed, 2, null, event);
checkButtonClicked("Chicken 1", 5, player, ConflictPlugin.skillFoodChicken, 1, null, event);
checkButtonClicked("Cow 1", 5, player, ConflictPlugin.skillFoodCow, 1, null, event);
checkButtonClicked("Fish 1", 5, player, ConflictPlugin.skillFoodFish, 1, null, event);
checkButtonClicked("Pig 1", 5, player, ConflictPlugin.skillFoodPork, 1, null, event);
if (event.getButton().getText().equals("Fight")) {
player.getMainScreen().closePopup();
createOverlayFight(player);
} else if (event.getButton().getText().equals("Craft")) {
player.getMainScreen().closePopup();
createOverlayCraft(player);
} else if (event.getButton().getText().equals("Mine")) {
player.getMainScreen().closePopup();
createOverlayMine(player);
} else if (event.getButton().getText().equals("Food")) {
player.getMainScreen().closePopup();
createOverlayFood(player);
}
}