From 5ca80bf28344bb14e34f4a13eb89ae9caa7219a4 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 12 Jul 2019 06:20:02 +0200 Subject: [PATCH] Showing Kit Item only with more than 1 Kit availible --- src/me/yaruma/fightsystem/fight/FightTeam.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/me/yaruma/fightsystem/fight/FightTeam.java b/src/me/yaruma/fightsystem/fight/FightTeam.java index b07216d..5703305 100644 --- a/src/me/yaruma/fightsystem/fight/FightTeam.java +++ b/src/me/yaruma/fightsystem/fight/FightTeam.java @@ -106,7 +106,8 @@ public class FightTeam { player.setGameMode(GameMode.ADVENTURE); player.teleport(spawn); - player.getInventory().setItem(1, new ItemBuilder(Material.LEATHER_CHESTPLATE).removeAllAtributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§eKit wählen").build()); + if(KitManager.getKits(false).size() > 1) + player.getInventory().setItem(1, new ItemBuilder(Material.LEATHER_CHESTPLATE).removeAllAtributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§eKit wählen").build()); TechHider.reloadChunks(player, chunksToReload); return fightPlayer; } @@ -155,6 +156,10 @@ public class FightTeam { leader.setKit(KitManager.getKitByName(Config.LeaderDefault)); Inventory inventory = leader.getPlayer().getInventory(); inventory.setItem(0, new ItemBuilder(Material.PAPER).removeAllAtributs().setDisplayName("§eSpieler einladen").build()); + if(KitManager.getKits(true).size() > 1) + inventory.setItem(1, new ItemBuilder(Material.LEATHER_CHESTPLATE).removeAllAtributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§eKit wählen").build()); + else + inventory.setItem(1, new ItemBuilder(Material.AIR).build()); inventory.setItem(2, new ItemBuilder(Material.FIREWORK_CHARGE).removeAllAtributs().setDisplayName("§cSpieler rauswerfen").build()); inventory.setItem(3, new ItemBuilder(Material.INK_SACK, (short) 10).removeAllAtributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build()); inventory.setItem(5, new ItemBuilder(Material.INK_SACK, (short) 1).removeAllAtributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§4Abbrechen").build());