From 131669c9ff261fa1cdcbe5fba6bcf43c27cf9175 Mon Sep 17 00:00:00 2001 From: grimmauld Date: Sun, 11 Oct 2020 12:38:50 +0200 Subject: [PATCH] Temporarily fix fluid tag serialization --- .../create/foundation/fluid/FluidIngredient.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java b/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java index d8c0d3fd6..97c3525dd 100644 --- a/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java +++ b/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java @@ -1,6 +1,7 @@ package com.simibubi.create.foundation.fluid; import java.util.Objects; +import java.util.Optional; import java.util.function.Predicate; import javax.annotation.Nullable; @@ -182,11 +183,11 @@ public abstract class FluidIngredient implements Predicate { @Override protected void readInternal(JsonObject json) { ResourceLocation id = new ResourceLocation(JSONUtils.getString(json, "fluidTag")); - ITag tmpTag = FluidTags.func_226157_a_() - .get(id); - if (tmpTag == null) + Optional> optionalINamedTag = FluidTags.getRequiredTags().stream() + .filter(fluidINamedTag -> fluidINamedTag.getId().equals(id)).findFirst(); // fixme + if (!optionalINamedTag.isPresent()) throw new JsonSyntaxException("Unknown fluid tag '" + id + "'"); - tag = new NamedTag<>(tmpTag, id); + tag = optionalINamedTag.get(); } @Override