Temporarily fix fluid tag serialization

This commit is contained in:
grimmauld 2020-10-11 12:38:50 +02:00
parent 3e3b0dad6e
commit 131669c9ff

View file

@ -1,6 +1,7 @@
package com.simibubi.create.foundation.fluid; package com.simibubi.create.foundation.fluid;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import java.util.function.Predicate; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -182,11 +183,11 @@ public abstract class FluidIngredient implements Predicate<FluidStack> {
@Override @Override
protected void readInternal(JsonObject json) { protected void readInternal(JsonObject json) {
ResourceLocation id = new ResourceLocation(JSONUtils.getString(json, "fluidTag")); ResourceLocation id = new ResourceLocation(JSONUtils.getString(json, "fluidTag"));
ITag<Fluid> tmpTag = FluidTags.func_226157_a_() Optional<? extends ITag.INamedTag<Fluid>> optionalINamedTag = FluidTags.getRequiredTags().stream()
.get(id); .filter(fluidINamedTag -> fluidINamedTag.getId().equals(id)).findFirst(); // fixme
if (tmpTag == null) if (!optionalINamedTag.isPresent())
throw new JsonSyntaxException("Unknown fluid tag '" + id + "'"); throw new JsonSyntaxException("Unknown fluid tag '" + id + "'");
tag = new NamedTag<>(tmpTag, id); tag = optionalINamedTag.get();
} }
@Override @Override