Skip to content

Commit

Permalink
fix: Spirit trade recipe crash
Browse files Browse the repository at this point in the history
Closes #1169

The crash did not repro in dev, but in prod. May be due to different behaviours of the JBR I am using? Not sure.
But ensuring a modifyable list fixes it.
  • Loading branch information
klikli-dev committed Jul 26, 2024
1 parent 9259389 commit a6bca30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ minecraft_version_range=[1.21,1.22)

## Neo
# The neo version must agree with the Minecraft version to get a valid artifact
neo_version=21.0.114-beta
neo_version=21.0.135-beta
# The neo version range can use any version of neo as bounds or match the loader version range
neo_version_range=[21.0.110-beta,)
# The loader version range can only use the major version of Neo/FML as bounds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ public boolean isValid(ItemStack... input) {

public boolean isValid(List<ItemStack> input) {
//deep copy, otherwise stack.shrink will eat original input.
List<ItemStack> cached = input.stream().map(ItemStack::copy).toList();
//we use collect(collectors.toList), because toList() would return an unmodifiable list
//noinspection SimplifyStreamApiCallChains
List<ItemStack> cached = input.stream().map(ItemStack::copy).collect(Collectors.toList());
for (Ingredient ingredient : this.getIngredients()) {
boolean matched = false;
for (Iterator<ItemStack> it = cached.iterator(); it.hasNext(); ) {
Expand Down

0 comments on commit a6bca30

Please sign in to comment.