Skip to content

Commit

Permalink
Fix ingredient choices not applying to RecipeCreator after editing th…
Browse files Browse the repository at this point in the history
…em via the ingredient menu

* This affected the Anvil, Cauldron, Cooking, Grindstone, Smithing and Stonecutter Recipe Creator
  • Loading branch information
WolfyScript committed Mar 17, 2024
1 parent d5ed0bc commit a2a4671
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ protected CustomRecipeAnvil create(CustomRecipeAnvil recipe) {

@Override
public void setIngredient(int slot, Ingredient ingredient) {
if (ingredient != null) {
ingredient.buildChoices();
}
if (slot == 0) {
this.base = ingredient;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public class RecipeCacheCauldron extends RecipeCache<CustomRecipeCauldron> {

@Override
public void setIngredient(int slot, Ingredient ingredient) {
if (ingredient != null) {
ingredient.buildChoices();
}
if (slot < ingredients.size()) {
ingredients.set(slot, ingredient);
} else if (ingredients.size() < 6){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public Ingredient getSource() {
}

public void setSource(Ingredient source) {
if (source != null) {
source.buildChoices();
}
this.source = source;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public class RecipeCacheGrinding extends RecipeCache<CustomRecipeGrindstone> {

@Override
public void setIngredient(int slot, Ingredient ingredient) {
if (ingredient != null) {
ingredient.buildChoices();
}
if (slot == 0) {
setInputTop(ingredient);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ protected CustomRecipeSmithing create(CustomRecipeSmithing recipe) {
}

public void setTemplate(Ingredient template) {
if (template != null) {
template.buildChoices();
}
this.template = template;
if (template == null || template.isEmpty()) {
this.template = new Ingredient();
Expand All @@ -118,6 +121,9 @@ public Ingredient getBase() {
}

public void setBase(Ingredient base) {
if (base != null) {
base.buildChoices();
}
this.base = base;
if (base == null || base.isEmpty()) {
this.base = new Ingredient();
Expand All @@ -132,6 +138,9 @@ public Ingredient getAddition() {
}

public void setAddition(Ingredient addition) {
if (addition != null) {
addition.buildChoices();
}
this.addition = addition;
if (addition == null || addition.isEmpty()) {
this.addition = new Ingredient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public Ingredient getSource() {
}

public void setSource(Ingredient source) {
if (source != null) {
source.buildChoices();
}
this.source = source;
}
}

0 comments on commit a2a4671

Please sign in to comment.