From e3db5f892cbc0152c8658818c867ef36707570dd Mon Sep 17 00:00:00 2001 From: LuukFTF Date: Sat, 5 Oct 2019 00:43:40 +0200 Subject: [PATCH] Added crafting recipe for dragons breath. Fixed typo. --- README.md | 1 + .../vanillatweaks/CraftingTweaks/CraftingTweaks.java | 11 +++++++++-- .../nl/kallestruik/vanillatweaks/VanillaTweaks.java | 2 ++ .../java/nl/kallestruik/vanillatweaks/config.java | 2 ++ src/main/resources/config.yml | 1 + 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 699ca75..1651ffb 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Currently included: - 3 leather + 2 string + 2 iron ingot -> 1 saddle - 1 blue ice -> 9 packed ice - 1 packed ice -> 9 ice +- 3 glass + 1 popped chorus fruit -> 3 dragons breath ### Dropped seed planting Automatically plants seed dropped on tilled soil. diff --git a/src/main/java/nl/kallestruik/vanillatweaks/CraftingTweaks/CraftingTweaks.java b/src/main/java/nl/kallestruik/vanillatweaks/CraftingTweaks/CraftingTweaks.java index de63a38..edcd2c6 100644 --- a/src/main/java/nl/kallestruik/vanillatweaks/CraftingTweaks/CraftingTweaks.java +++ b/src/main/java/nl/kallestruik/vanillatweaks/CraftingTweaks/CraftingTweaks.java @@ -49,7 +49,14 @@ public class CraftingTweaks { // 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); + iceRecipe.addIngredient(Material.PACKED_ICE); + + // Dragons breath + NamespacedKey dragonBreathKey = new NamespacedKey(plugin, "dragon_breath"); + ShapedRecipe dragonBreathRecipe = new ShapedRecipe(dragonBreathKey, new ItemStack(Material.DRAGON_BREATH, 3)); + dragonBreathRecipe.shape("GCG", " G "); + dragonBreathRecipe.setIngredient('G', Material.GLASS); + dragonBreathRecipe.setIngredient('C', Material.POPPED_CHORUS_FRUIT); // Add recipes if (config.CRAFTING_TWEAKS_BETTER_CHEST) plugin.getServer().addRecipe(chestRecipe); @@ -58,6 +65,6 @@ public class CraftingTweaks { 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); - + if (config.CRAFTING_TWEAKS_DRAGONS_BREATH) plugin.getServer().addRecipe(dragonBreathRecipe); } } diff --git a/src/main/java/nl/kallestruik/vanillatweaks/VanillaTweaks.java b/src/main/java/nl/kallestruik/vanillatweaks/VanillaTweaks.java index 3a330be..109704b 100644 --- a/src/main/java/nl/kallestruik/vanillatweaks/VanillaTweaks.java +++ b/src/main/java/nl/kallestruik/vanillatweaks/VanillaTweaks.java @@ -52,6 +52,8 @@ public final class VanillaTweaks extends JavaPlugin { getServer().getPluginManager().registerEvents(new HoeHarvestingHandler(), this); } + + } catch (IOException | InvalidConfigurationException | NullPointerException e) { util.printException(e); } diff --git a/src/main/java/nl/kallestruik/vanillatweaks/config.java b/src/main/java/nl/kallestruik/vanillatweaks/config.java index c05e8fd..3ce4165 100644 --- a/src/main/java/nl/kallestruik/vanillatweaks/config.java +++ b/src/main/java/nl/kallestruik/vanillatweaks/config.java @@ -17,6 +17,7 @@ public class config { public static boolean CRAFTING_TWEAKS_SADDLE; public static boolean CRAFTING_TWEAKS_PACKED_ICE; public static boolean CRAFTING_TWEAKS_ICE; + public static boolean CRAFTING_TWEAKS_DRAGONS_BREATH; public static boolean SEED_DROP_PLANTING_ENABLED; @@ -48,6 +49,7 @@ public class config { 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"); + CRAFTING_TWEAKS_DRAGONS_BREATH = config.getBoolean("crafting-tweaks.dragons-breath"); 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 07011dd..7e1c109 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -9,6 +9,7 @@ crafting-tweaks: saddle: true packed-ice: true ice: true + dragons-breath: true seed-drop-planting: enabled: true