Skip to content

Commit

Permalink
Fix recipe item type predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa committed Feb 15, 2025
1 parent ed1ea15 commit 6f3610c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public class SpongeIngredient extends Ingredient {
return DataResult.success(new SpongeRawIngredient(spongeIngredient.type, stacks, Optional.empty()));
}
case SpongePredicateItemList.TYPE_PREDICATE -> {
return DataResult.success(new SpongeRawIngredient(spongeIngredient.type, List.of(), Optional.ofNullable(spongeIngredient.predicateId)));
var stacks = Arrays.stream(spongeIngredient.values).flatMap(v -> v.getItems().stream()).toList();
return DataResult.success(new SpongeRawIngredient(spongeIngredient.type, stacks, Optional.ofNullable(spongeIngredient.predicateId)));
}
}
throw new NotImplementedException("Serializing SpongeIngredient is not implemented yet.");
Expand Down

0 comments on commit 6f3610c

Please sign in to comment.