Skip to content

Commit

Permalink
fix: fluid ingredient deserialization
Browse files Browse the repository at this point in the history
Fixes #140
  • Loading branch information
klikli-dev committed Jul 30, 2023
1 parent e2964a1 commit a048f3f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public static FluidIngredient fromJson(@Nullable JsonElement pJson) {

public static FluidIngredient fromNetwork(FriendlyByteBuf pBuffer) {
var size = pBuffer.readVarInt();
if (size == -1)
throw new UnsupportedOperationException("FluidIngredients should never be serialized with size -1!");
if (size == -1) //indicates non vanilla ingredient, so we should hit that every time
return (FluidIngredient) net.minecraftforge.common.crafting.CraftingHelper.getIngredient(pBuffer.readResourceLocation(), pBuffer);
return fromFluidValues(Stream.generate(() -> new FluidValue(pBuffer.readFluidStack())).limit(size));
}

Expand Down

0 comments on commit a048f3f

Please sign in to comment.