From 672fe9d69ee158638b3a0497efb731ebb02bf16a Mon Sep 17 00:00:00 2001 From: Xavier Beatrice <58835993+Xavbeat03@users.noreply.github.com> Date: Sun, 22 Sep 2024 18:31:11 -0400 Subject: [PATCH] feat: add new crafting recipes for rails and powered rails (#126) - Updated the crafting recipe for rails so it yields 64 rails per craft. - Updated the crafting recipe for powered rails so it yields 32 powered rails per craft. - Updated the `registerAllCraftingRecipes` method to include the new recipes. --- .../crafting/CraftingRecipes.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/me/ShermansWorld/AlathraExtras/crafting/CraftingRecipes.java b/src/main/java/me/ShermansWorld/AlathraExtras/crafting/CraftingRecipes.java index f343d93..5afe046 100644 --- a/src/main/java/me/ShermansWorld/AlathraExtras/crafting/CraftingRecipes.java +++ b/src/main/java/me/ShermansWorld/AlathraExtras/crafting/CraftingRecipes.java @@ -156,6 +156,29 @@ public static void pinkPetalsRecipe() { AlathraExtras.getInstance().getServer().addRecipe(pinkPetalsRecipe); } + public static void railsRecipe() { + ItemStack rails = new ItemStack(Material.RAIL, 64); + NamespacedKey key = new NamespacedKey(AlathraExtras.getInstance(), + AlathraExtras.getInstance().getName() + "railsRecipe"); + ShapedRecipe railsRecipe = new ShapedRecipe(key, rails); + railsRecipe.shape("I I", "ISI", "I I"); + railsRecipe.setIngredient('I', Material.IRON_INGOT); + railsRecipe.setIngredient('S', Material.STICK); + AlathraExtras.getInstance().getServer().addRecipe(railsRecipe); + } + + public static void poweredRailsRecipe() { + ItemStack poweredRails = new ItemStack(Material.POWERED_RAIL, 24); + NamespacedKey key = new NamespacedKey(AlathraExtras.getInstance(), + AlathraExtras.getInstance().getName() + "poweredRailsRecipe"); + ShapedRecipe poweredRailsRecipe = new ShapedRecipe(key, poweredRails); + poweredRailsRecipe.shape("G G", "GSG", "GRG"); + poweredRailsRecipe.setIngredient('G', Material.GOLD_INGOT); + poweredRailsRecipe.setIngredient('S', Material.STICK); + poweredRailsRecipe.setIngredient('R', Material.REDSTONE); + AlathraExtras.getInstance().getServer().addRecipe(poweredRailsRecipe); + } + public static void stonesToGravel(int a) { for (int b = 0; b <= a; b++) { NamespacedKey key = new NamespacedKey(AlathraExtras.getInstance(), @@ -674,5 +697,7 @@ public static void registerAllCraftingRecipes() { mustacheRecipe(); crownRecipe(); wreathRecipe(); + railsRecipe(); + poweredRailsRecipe(); } }