mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-28 16:06:48 +01:00
Temporarily fix fluid tag serialization
This commit is contained in:
parent
3e3b0dad6e
commit
131669c9ff
1 changed files with 5 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue