Skip to content

Commit

Permalink
Add missing final modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Choonster committed Jun 23, 2024
1 parent c00e0ac commit f3bea10
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void appendHoverText(final ItemStack stack, final TooltipContext context,
}

public record EntityCheckerProperties(int radius, boolean cornerModeEnabled) {
public static Codec<EntityCheckerProperties> CODEC = RecordCodecBuilder.create(builder ->
public static final Codec<EntityCheckerProperties> CODEC = RecordCodecBuilder.create(builder ->
builder.group(

Codec.INT
Expand All @@ -170,14 +170,14 @@ public record EntityCheckerProperties(int radius, boolean cornerModeEnabled) {
).apply(builder, EntityCheckerProperties::new)
);

public static StreamCodec<RegistryFriendlyByteBuf, EntityCheckerProperties> NETWORK_CODEC = StreamCodec.composite(
public static final StreamCodec<RegistryFriendlyByteBuf, EntityCheckerProperties> NETWORK_CODEC = StreamCodec.composite(
ByteBufCodecs.VAR_INT,
EntityCheckerProperties::radius,
ByteBufCodecs.BOOL,
EntityCheckerProperties::cornerModeEnabled,
EntityCheckerProperties::new
);

public static EntityCheckerProperties DEFAULT = new EntityCheckerProperties(0, false);
public static final EntityCheckerProperties DEFAULT = new EntityCheckerProperties(0, false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public void appendHoverText(final ItemStack stack, final TooltipContext context,
}

public record ReplacedArmour(ImmutableList<Entry> replacedArmour) {
public static Codec<ReplacedArmour> CODEC = RecordCodecBuilder.create(builder ->
public static final Codec<ReplacedArmour> CODEC = RecordCodecBuilder.create(builder ->
builder.group(

Entry.CODEC
Expand All @@ -227,7 +227,7 @@ public record ReplacedArmour(ImmutableList<Entry> replacedArmour) {
).apply(builder, ReplacedArmour::new)
);

public static StreamCodec<RegistryFriendlyByteBuf, ReplacedArmour> STREAM_CODEC = StreamCodec.composite(
public static final StreamCodec<RegistryFriendlyByteBuf, ReplacedArmour> STREAM_CODEC = StreamCodec.composite(
Entry.STREAM_CODEC.apply(ByteBufCodecs.list()),
ReplacedArmour::replacedArmour,
ReplacedArmour::new
Expand All @@ -238,7 +238,7 @@ public ReplacedArmour(final List<Entry> replacedArmour) {
}

public record Entry(EquipmentSlot slot, ItemStack replacedArmour) {
public static Codec<Entry> CODEC = RecordCodecBuilder.create(builder ->
public static final Codec<Entry> CODEC = RecordCodecBuilder.create(builder ->
builder.group(
EquipmentSlot.CODEC
.fieldOf("slot")
Expand All @@ -250,7 +250,7 @@ public record Entry(EquipmentSlot slot, ItemStack replacedArmour) {
).apply(builder, Entry::new)
);

public static StreamCodec<RegistryFriendlyByteBuf, Entry> STREAM_CODEC = StreamCodec.composite(
public static final StreamCodec<RegistryFriendlyByteBuf, Entry> STREAM_CODEC = StreamCodec.composite(
VanillaCodecs.ARMOR_ITEM_EQUIPMENT_SLOT_STREAM_CODEC,
Entry::slot,
ItemStack.STREAM_CODEC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @author Choonster
*/
public record LastUseTimeProperties(long lastUseTime, boolean automaticUpdates) {
public static Codec<LastUseTimeProperties> CODEC = RecordCodecBuilder.create(builder ->
public static final Codec<LastUseTimeProperties> CODEC = RecordCodecBuilder.create(builder ->
builder.group(

Codec.LONG
Expand All @@ -26,7 +26,7 @@ public record LastUseTimeProperties(long lastUseTime, boolean automaticUpdates)
).apply(builder, LastUseTimeProperties::new)
);

public static StreamCodec<RegistryFriendlyByteBuf, LastUseTimeProperties> NETWORK_CODEC = StreamCodec.composite(
public static final StreamCodec<RegistryFriendlyByteBuf, LastUseTimeProperties> NETWORK_CODEC = StreamCodec.composite(
ByteBufCodecs.VAR_LONG,
LastUseTimeProperties::lastUseTime,
ByteBufCodecs.BOOL,
Expand Down

0 comments on commit f3bea10

Please sign in to comment.