From 43aee539c4fc888d4d2090cf26164a8644cb807b Mon Sep 17 00:00:00 2001 From: dragontamerfred Date: Thu, 3 Oct 2019 19:01:48 +0200 Subject: [PATCH] Add recipes for packed ice and normal ice (from blue and packed ice) --- .../CraftingTweaks/CraftingTweaks.java | 13 +++++++++++++ .../java/nl/kallestruik/vanillatweaks/config.java | 4 ++++ src/main/resources/config.yml | 2 ++ 3 files changed, 19 insertions(+) diff --git a/src/main/java/nl/kallestruik/vanillatweaks/CraftingTweaks/CraftingTweaks.java b/src/main/java/nl/kallestruik/vanillatweaks/CraftingTweaks/CraftingTweaks.java index ce9efeb..de63a38 100644 --- a/src/main/java/nl/kallestruik/vanillatweaks/CraftingTweaks/CraftingTweaks.java +++ b/src/main/java/nl/kallestruik/vanillatweaks/CraftingTweaks/CraftingTweaks.java @@ -41,10 +41,23 @@ public class CraftingTweaks { saddleRecipe.setIngredient('S', Material.STRING); saddleRecipe.setIngredient('I', Material.IRON_INGOT); + // Blue ice -> 9 packed ice + NamespacedKey packedIceKey = new NamespacedKey(plugin, "packed_ice"); + ShapelessRecipe packedIceRecipe = new ShapelessRecipe(packedIceKey, new ItemStack(Material.PACKED_ICE, 9)); + packedIceRecipe.addIngredient(Material.BLUE_ICE); + + // Packed ice -> 9 ice + NamespacedKey iceKey = new NamespacedKey(plugin, "ice"); + ShapelessRecipe iceRecipe = new ShapelessRecipe(iceKey, new ItemStack(Material.ICE, 9)); + packedIceRecipe.addIngredient(Material.PACKED_ICE); + // Add recipes if (config.CRAFTING_TWEAKS_BETTER_CHEST) plugin.getServer().addRecipe(chestRecipe); if (config.CRAFTING_TWEAKS_NAME_TAG) plugin.getServer().addRecipe(nametagRecipe); if (config.CRAFTING_TWEAKS_WOOL_TO_STRING) plugin.getServer().addRecipe(stringRecipe); if (config.CRAFTING_TWEAKS_SADDLE) plugin.getServer().addRecipe(saddleRecipe); + if (config.CRAFTING_TWEAKS_PACKED_ICE) plugin.getServer().addRecipe(packedIceRecipe); + if (config.CRAFTING_TWEAKS_ICE) plugin.getServer().addRecipe(iceRecipe); + } } diff --git a/src/main/java/nl/kallestruik/vanillatweaks/config.java b/src/main/java/nl/kallestruik/vanillatweaks/config.java index 0a179ea..af16ebd 100644 --- a/src/main/java/nl/kallestruik/vanillatweaks/config.java +++ b/src/main/java/nl/kallestruik/vanillatweaks/config.java @@ -15,6 +15,8 @@ public class config { public static boolean CRAFTING_TWEAKS_NAME_TAG; public static boolean CRAFTING_TWEAKS_WOOL_TO_STRING; public static boolean CRAFTING_TWEAKS_SADDLE; + public static boolean CRAFTING_TWEAKS_PACKED_ICE; + public static boolean CRAFTING_TWEAKS_ICE; public static boolean SEED_DROP_PLANTING_ENABLED; @@ -37,6 +39,8 @@ public class config { CRAFTING_TWEAKS_NAME_TAG = config.getBoolean("crafting-tweaks.name-tag"); CRAFTING_TWEAKS_WOOL_TO_STRING = config.getBoolean("crafting-tweaks.wool-to-string"); CRAFTING_TWEAKS_SADDLE = config.getBoolean("crafting-tweaks.saddle"); + CRAFTING_TWEAKS_PACKED_ICE = config.getBoolean("crafting-tweaks.packed-ice"); + CRAFTING_TWEAKS_ICE = config.getBoolean("crafting-tweaks.ice"); SEED_DROP_PLANTING_ENABLED = config.getBoolean("seed-drop-planting.enabled"); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 2460a0f..17fa9b4 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -7,6 +7,8 @@ crafting-tweaks: name-tag: true wool-to-string: true saddle: true + packed-ice: true + ice: true seed-drop-planting: enabled: true