From 674725f2fd077272ddb3fc39b169a7581a340716 Mon Sep 17 00:00:00 2001 From: EagleEyeLogic <69814047+EagleEyeLogic@users.noreply.github.com> Date: Sat, 6 Jul 2024 23:06:12 +0200 Subject: [PATCH] Update DendroBrewingRecipe.java --- .../util/DendroBrewingRecipe.java | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/ferreusveritas/dynamictrees/util/DendroBrewingRecipe.java b/src/main/java/com/ferreusveritas/dynamictrees/util/DendroBrewingRecipe.java index 42b6ae10a..09818b624 100644 --- a/src/main/java/com/ferreusveritas/dynamictrees/util/DendroBrewingRecipe.java +++ b/src/main/java/com/ferreusveritas/dynamictrees/util/DendroBrewingRecipe.java @@ -26,48 +26,45 @@ public DendroBrewingRecipe(final ItemStack input, final ItemStack ingredient, fi @Override public boolean isInput(final ItemStack inputStack) { - // Only allow Potion.AWKWARD or DendroPotion and for DendroPotion.TRANSFORM, only if it doesn't already have a tree tag. - if ((!inputStack.getOrCreateTag().contains(DendroPotion.TREE_TAG_KEY) && inputStack.getOrCreateTag().contains(DendroPotion.INDEX_TAG_KEY)) || inputStack.getItem() == Items.POTION) { + // Only allow Potion.AWKWARD or DendroPotion and for DendroPotion.TRANSFORM, only if it doesn't already have a tree tag. + if ((!inputStack.getOrCreateTag().contains(DendroPotion.TREE_TAG_KEY) && inputStack.getOrCreateTag().contains(DendroPotion.INDEX_TAG_KEY)) || inputStack.getItem() == Items.POTION) { return true; - } - return false; } + return false; + } @Override public boolean isIngredient(final ItemStack ingredientStack) { - return this.ingredient.getItem().equals(ingredientStack.getItem()); + return this.ingredient.getItem().equals(ingredientStack.getItem()); } @Override public ItemStack getOutput(final ItemStack inputStack, final ItemStack ingredientStack) { - // We need to apply logic for the brewing or simply the ingredient defines the output and any input was allowed - // A smarter way would be nice, but it works - if (!inputStack.isEmpty() && !ingredientStack.isEmpty() && isIngredient(ingredientStack) && isInput(inputStack)) { - if (ingredientStack.is(Items.CHARCOAL) && PotionUtils.getPotion(inputStack) == Potion.byName("awkward")) { - return this.output.copy(); - } - if (ingredientStack.is(Items.CHARCOAL) | inputStack.getItem() == Items.POTION) { - return ItemStack.EMPTY; - } - if ((ingredientStack.is(Items.SLIME_BALL) || ingredientStack.is(Items.PUMPKIN_SEEDS) || ingredientStack.is(Items.GHAST_TEAR) || ingredientStack.is(Items.PRISMARINE_CRYSTALS)) && DendroPotion.getPotionType(inputStack) == DendroPotion.DendroPotionType.BIOCHAR) { - return this.output.copy(); - } - if ((ingredientStack.is(Items.SLIME_BALL) || ingredientStack.is(Items.PUMPKIN_SEEDS) || ingredientStack.is(Items.GHAST_TEAR) || ingredientStack.is(Items.PRISMARINE_CRYSTALS)) | DendroPotion.getPotionType(inputStack) != DendroPotion.DendroPotionType.TRANSFORM) { - return ItemStack.EMPTY; - } - return this.output.copy(); - } - return ItemStack.EMPTY; - } - + // We need to apply logic for the brewing or simply the ingredient defines the output and any input was allowed + // A smarter way would be nice, but it works + if (!inputStack.isEmpty() && !ingredientStack.isEmpty() && isIngredient(ingredientStack) && isInput(inputStack)) { + if (ingredientStack.is(Items.CHARCOAL) && PotionUtils.getPotion(inputStack) == Potion.byName("awkward")) { + return this.output.copy(); + } + if (ingredientStack.is(Items.CHARCOAL) | inputStack.getItem() == Items.POTION) { + return ItemStack.EMPTY; + } + if ((ingredientStack.is(Items.SLIME_BALL) || ingredientStack.is(Items.PUMPKIN_SEEDS) || ingredientStack.is(Items.GHAST_TEAR) || ingredientStack.is(Items.PRISMARINE_CRYSTALS)) && DendroPotion.getPotionType(inputStack) == DendroPotion.DendroPotionType.BIOCHAR) { + return this.output.copy(); + } + if ((ingredientStack.is(Items.SLIME_BALL) || ingredientStack.is(Items.PUMPKIN_SEEDS) || ingredientStack.is(Items.GHAST_TEAR) || ingredientStack.is(Items.PRISMARINE_CRYSTALS)) | DendroPotion.getPotionType(inputStack) != DendroPotion.DendroPotionType.TRANSFORM) { + return ItemStack.EMPTY; + } + return this.output.copy(); + } + return ItemStack.EMPTY; + } public ItemStack getInput() { return input; } - public ItemStack getIngredient() { return ingredient; } - public ItemStack getOutput() { return output; }