You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public record NamespaceIngredient(Stringnamespace) implementsICustomIngredient {
publicstaticfinalMapCodec<NamespaceIngredient> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.STRING.fieldOf("namespace").forGetter(NamespaceIngredient::namespace)
).apply(instance, NamespaceIngredient::new));
publicstaticfinalStreamCodec<ByteBuf, NamespaceIngredient> STREAM_CODEC = ByteBufCodecs.STRING_UTF8.map(NamespaceIngredient::new, NamespaceIngredient::namespace);
Description of issue:
StreamCodec<ByteBuf, ... should be allowed in constructors of IngredientType and FluidIngredientType, but only specifically StreamCodec<RegistryFriendlyByteBuf is.
The way to fix this is change StreamCodec<RegistryFriendlyByteBuf to StreamCodec<? super RegistryFriendlyByteBuf like most other places in Minecraft for both ingredient types.
Temp fix:
Casting the stream codec to diamond-less (StreamCodec) works. Example:
Minecraft Version: 1.21
NeoForge Version: 21.0.37-beta
Example class:
Description of issue:
StreamCodec<ByteBuf, ...
should be allowed in constructors of IngredientType and FluidIngredientType, but only specificallyStreamCodec<RegistryFriendlyByteBuf
is.Using this
will fail to compile with
![](https://camo.githubusercontent.com/204d05666650aca272ebd18fcd7951cb877fc24acd8332ad8c0cb14c099966bf/68747470733a2f2f692e6c61747669616e2e6465762f70632f323032342d30362d32375f30322e31342e32342e706e67)
The way to fix this is change
StreamCodec<RegistryFriendlyByteBuf
toStreamCodec<? super RegistryFriendlyByteBuf
like most other places in Minecraft for both ingredient types.Temp fix:
Casting the stream codec to diamond-less (StreamCodec) works. Example:
The text was updated successfully, but these errors were encountered: