diff --git a/src/main/java/choonster/testmod3/world/item/EntityCheckerItem.java b/src/main/java/choonster/testmod3/world/item/EntityCheckerItem.java index 228ebc35..e855ffc8 100644 --- a/src/main/java/choonster/testmod3/world/item/EntityCheckerItem.java +++ b/src/main/java/choonster/testmod3/world/item/EntityCheckerItem.java @@ -156,7 +156,7 @@ public void appendHoverText(final ItemStack stack, final TooltipContext context, } public record EntityCheckerProperties(int radius, boolean cornerModeEnabled) { - public static Codec CODEC = RecordCodecBuilder.create(builder -> + public static final Codec CODEC = RecordCodecBuilder.create(builder -> builder.group( Codec.INT @@ -170,7 +170,7 @@ public record EntityCheckerProperties(int radius, boolean cornerModeEnabled) { ).apply(builder, EntityCheckerProperties::new) ); - public static StreamCodec NETWORK_CODEC = StreamCodec.composite( + public static final StreamCodec NETWORK_CODEC = StreamCodec.composite( ByteBufCodecs.VAR_INT, EntityCheckerProperties::radius, ByteBufCodecs.BOOL, @@ -178,6 +178,6 @@ public record EntityCheckerProperties(int radius, boolean cornerModeEnabled) { EntityCheckerProperties::new ); - public static EntityCheckerProperties DEFAULT = new EntityCheckerProperties(0, false); + public static final EntityCheckerProperties DEFAULT = new EntityCheckerProperties(0, false); } } diff --git a/src/main/java/choonster/testmod3/world/item/ReplacementArmourItem.java b/src/main/java/choonster/testmod3/world/item/ReplacementArmourItem.java index 8bc65cf1..206a9f78 100644 --- a/src/main/java/choonster/testmod3/world/item/ReplacementArmourItem.java +++ b/src/main/java/choonster/testmod3/world/item/ReplacementArmourItem.java @@ -216,7 +216,7 @@ public void appendHoverText(final ItemStack stack, final TooltipContext context, } public record ReplacedArmour(ImmutableList replacedArmour) { - public static Codec CODEC = RecordCodecBuilder.create(builder -> + public static final Codec CODEC = RecordCodecBuilder.create(builder -> builder.group( Entry.CODEC @@ -227,7 +227,7 @@ public record ReplacedArmour(ImmutableList replacedArmour) { ).apply(builder, ReplacedArmour::new) ); - public static StreamCodec STREAM_CODEC = StreamCodec.composite( + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( Entry.STREAM_CODEC.apply(ByteBufCodecs.list()), ReplacedArmour::replacedArmour, ReplacedArmour::new @@ -238,7 +238,7 @@ public ReplacedArmour(final List replacedArmour) { } public record Entry(EquipmentSlot slot, ItemStack replacedArmour) { - public static Codec CODEC = RecordCodecBuilder.create(builder -> + public static final Codec CODEC = RecordCodecBuilder.create(builder -> builder.group( EquipmentSlot.CODEC .fieldOf("slot") @@ -250,7 +250,7 @@ public record Entry(EquipmentSlot slot, ItemStack replacedArmour) { ).apply(builder, Entry::new) ); - public static StreamCodec STREAM_CODEC = StreamCodec.composite( + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( VanillaCodecs.ARMOR_ITEM_EQUIPMENT_SLOT_STREAM_CODEC, Entry::slot, ItemStack.STREAM_CODEC, diff --git a/src/main/java/choonster/testmod3/world/item/component/lastusetime/LastUseTimeProperties.java b/src/main/java/choonster/testmod3/world/item/component/lastusetime/LastUseTimeProperties.java index c471de53..2fbb6261 100644 --- a/src/main/java/choonster/testmod3/world/item/component/lastusetime/LastUseTimeProperties.java +++ b/src/main/java/choonster/testmod3/world/item/component/lastusetime/LastUseTimeProperties.java @@ -12,7 +12,7 @@ * @author Choonster */ public record LastUseTimeProperties(long lastUseTime, boolean automaticUpdates) { - public static Codec CODEC = RecordCodecBuilder.create(builder -> + public static final Codec CODEC = RecordCodecBuilder.create(builder -> builder.group( Codec.LONG @@ -26,7 +26,7 @@ public record LastUseTimeProperties(long lastUseTime, boolean automaticUpdates) ).apply(builder, LastUseTimeProperties::new) ); - public static StreamCodec NETWORK_CODEC = StreamCodec.composite( + public static final StreamCodec NETWORK_CODEC = StreamCodec.composite( ByteBufCodecs.VAR_LONG, LastUseTimeProperties::lastUseTime, ByteBufCodecs.BOOL,