
Missing `amount` in `display_fluid` of example datapack
Prunoideae opened this issue ยท 1 comments
Is missing an amount
field since display_fluid
is serialized as a FluidStack
:
Since amount
in FluidStack
is now required:
public static final Codec<FluidStack> CODEC = Codec.lazyInitialized(
() -> RecordCodecBuilder.create(
instance -> instance.group(
FLUID_NON_EMPTY_CODEC.fieldOf("id").forGetter(FluidStack::getFluidHolder),
ExtraCodecs.POSITIVE_INT.fieldOf("amount").forGetter(FluidStack::getAmount), // note: no .orElse(1) compared to ItemStack
DataComponentPatch.CODEC.optionalFieldOf("components", DataComponentPatch.EMPTY)
.forGetter(stack -> stack.components.asPatch()))
.apply(instance, FluidStack::new)));
This will cause deserialization error when adding recipe support for KubeJS: