Skip to content

Commit

Permalink
Update DendroBrewingRecipe.java
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleEyeLogic authored Jul 6, 2024
1 parent 2fa2a38 commit 674725f
Showing 1 changed file with 24 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 674725f

Please sign in to comment.