Skip to content

Commit a6bca30

Browse files
committed
fix: Spirit trade recipe crash
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.
1 parent 9259389 commit a6bca30

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ minecraft_version_range=[1.21,1.22)
1414

1515
## Neo
1616
# The neo version must agree with the Minecraft version to get a valid artifact
17-
neo_version=21.0.114-beta
17+
neo_version=21.0.135-beta
1818
# The neo version range can use any version of neo as bounds or match the loader version range
1919
neo_version_range=[21.0.110-beta,)
2020
# The loader version range can only use the major version of Neo/FML as bounds

src/main/java/com/klikli_dev/occultism/crafting/recipe/SpiritTradeRecipe.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ public boolean isValid(ItemStack... input) {
108108

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

0 commit comments

Comments
 (0)