diff --git a/src/main/java/me/defender/cosmetics/api/configuration/ConfigUtils.java b/src/main/java/me/defender/cosmetics/api/configuration/ConfigUtils.java index 15f587bf..3ce08827 100644 --- a/src/main/java/me/defender/cosmetics/api/configuration/ConfigUtils.java +++ b/src/main/java/me/defender/cosmetics/api/configuration/ConfigUtils.java @@ -77,7 +77,8 @@ public static void saveIfNotFound(ConfigType configType, String path ,Object dat public static void addSlotsList(){ for (CosmeticsType cosmeticsType : CosmeticsType.values()){ - cosmeticsType.getConfig().getYml().addDefault("slots", Arrays.asList(10,11,12,13,14,15,16,19,20,21,22,23,24,25,28,29,30,31,32,33,34)); + cosmeticsType.getConfig().getYml().addDefault("slots", Arrays.asList(10,11,12,13,14,15,16,19,20,21,22,23,24,25,28,29,30,31,32,33,34).toString()); + cosmeticsType.getConfig().save(); } } diff --git a/src/main/java/me/defender/cosmetics/api/util/StartupUtils.java b/src/main/java/me/defender/cosmetics/api/util/StartupUtils.java index 8fd64cee..8b105dc5 100644 --- a/src/main/java/me/defender/cosmetics/api/util/StartupUtils.java +++ b/src/main/java/me/defender/cosmetics/api/util/StartupUtils.java @@ -237,7 +237,7 @@ public static void loadCosmetics(){ new pigmissile().register(); new squidmissile().register(); new theif().register(); - new tornado().register(); + new eggexplosion().register(); //Items From Config new DeathCryItems().registerConfigItems(); diff --git a/src/main/java/me/defender/cosmetics/menu/CategoryMenu.java b/src/main/java/me/defender/cosmetics/menu/CategoryMenu.java index 26f2ad01..3b1b0662 100644 --- a/src/main/java/me/defender/cosmetics/menu/CategoryMenu.java +++ b/src/main/java/me/defender/cosmetics/menu/CategoryMenu.java @@ -46,7 +46,13 @@ public CategoryMenu(CosmeticsType type) { this.config = type.getConfig(); this.cosmeticsType = type; title = type.getFormatedName(); - slots = config.getYml().getIntegerList("slots"); + String list = config.getString("slots"); + list = list.replace("[", "").replace("]", ""); + List integerList = new ArrayList<>(); + for (String s : list.split("\\s*,\\s*")) { + integerList.add(Integer.parseInt(s)); + } + slots = integerList; if(slots.isEmpty()){ slots = Arrays.asList(10,11,12,13,14,15,16,19,20,21,22,23,24,25,28,29,30,31,32,33,34); } @@ -84,7 +90,7 @@ public void onOpen(@NotNull Player player) { if(returnValue == 2){ colorCode = "&c"; } - if(returnValue == 0){ + if(returnValue == -2 ){ // <- Selected stack.addUnsafeEnchantment(Enchantment.LUCK, 1); } item = new ClickableItem(HCore.itemBuilder(stack).addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES).name(true, colorCode + formattedName).lores(true, lore1).build(), (e) -> { @@ -262,7 +268,7 @@ public int onClick(Player p, CosmeticsType type, int price, String id, boolean i p.playSound(p.getLocation(), XSound.ENTITY_ENDERMAN_TELEPORT.parseSound(), 1.0f, 1.0f); } } - return -1; + return -2; } public void previewClick(Player player, CosmeticsType type, String id, int price){