public static final Codec<Compostable> CODEC = RecordCodecBuilder.create(
13
i -> i.group(ResolvableInt.CODEC.fieldOf("layers").forGetter(Compostable::layers)).apply(i, Compostable::new)
14
);
15
public static final StreamCodec<ByteBuf, Compostable> STREAM_CODEC = StreamCodec.composite(ResolvableInt.STREAM_CODEC, Compostable::layers, Compostable::new);
16
17
public Compostable(final ResourceKey<ContextIntProvider> layers) {
18
this(ResolvableInt.fromKey(layers));
19
}
20
}
21
Decompiled Minecraft 26.3 source of Compostable (net/minecraft/world/item/component/Compostable.java) with Mojang official mappings, stored verbatim on the site.