Skip to content

Commit

Permalink
fix: storage disk upgrade recipes not showing properly in recipe viewers
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvdberge committed Dec 7, 2024
1 parent 409e057 commit 790e884
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Fixed External Fluid not connecting properly to fluid storages.
- Fixed Interface filter not respecting maximum stack size of a resource.
- Fixed potential crash when trying to build cable shapes.
- Fixed storage disk upgrade recipes not showing properly in recipe viewers.

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,24 @@ public StorageContainerUpgradeRecipe(final T[] variants,
"",
CraftingBookCategory.MISC,
containerProvider.apply(to).asItem().getDefaultInstance(),
NonNullList.of(
Ingredient.of(getValidSourceContainers(to, variants, containerProvider).toArray(new Item[0])),
Ingredient.of(to.getStoragePart())
)
getIngredients(variants, to, containerProvider)
);
this.validSourceContainers = getValidSourceContainers(to, variants, containerProvider);
this.variants = variants;
this.to = to;
}

private static <T extends StorageVariant> NonNullList<Ingredient> getIngredients(
final T[] variants,
final T to,
final Function<T, ItemLike> containerProvider
) {
final NonNullList<Ingredient> ingredients = NonNullList.create();
ingredients.add(Ingredient.of(getValidSourceContainers(to, variants, containerProvider).toArray(new Item[0])));
ingredients.add(Ingredient.of(to.getStoragePart()));
return ingredients;
}

public T[] getVariants() {
return variants;
}
Expand Down

0 comments on commit 790e884

Please sign in to comment.