Fix packet serialization errors

This commit is contained in:
Sollace 2024-10-04 18:31:52 +01:00
parent c70f3dcc5f
commit b2f0a846de
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 2 additions and 2 deletions

View file

@ -32,7 +32,7 @@ public interface Channel {
S2CPacketType<MsgServerResources> SERVER_RESOURCES = SimpleNetworking.serverToClient(Unicopia.id("resources"), MsgServerResources.PACKET_CODEC);
S2CPacketType<MsgTrackedValues> SERVER_TRACKED_ENTITY_DATA = SimpleNetworking.serverToClient(Unicopia.id("tracked_entity_date"), MsgTrackedValues.PACKET_CODEC);
S2CPacketType<MsgTrackedValues> SERVER_TRACKED_ENTITY_DATA = SimpleNetworking.serverToClient(Unicopia.id("tracked_entity_data"), MsgTrackedValues.PACKET_CODEC);
S2CPacketType<MsgPlayerAnimationChange> SERVER_PLAYER_ANIMATION_CHANGE = SimpleNetworking.serverToClient(Unicopia.id("player_animation_change"), MsgPlayerAnimationChange.PACKET_CODEC);
S2CPacketType<MsgSkyAngle> SERVER_SKY_ANGLE = SimpleNetworking.serverToClient(Unicopia.id("sky_angle"), MsgSkyAngle.PACKET_CODEC);
S2CPacketType<MsgConfigurationChange> CONFIGURATION_CHANGE = SimpleNetworking.serverToClient(Unicopia.id("config"), MsgConfigurationChange.PACKET_CODEC);

View file

@ -51,7 +51,7 @@ public interface PacketCodecUtils {
}
static <B extends ByteBuf, K, V> PacketCodec.ResultFunction<B, V, Map<K, V>> toMap(Function<V, K> keyFunction) {
return codec -> map(HashMap::new, codec, keyFunction, -1);
return codec -> map(HashMap::new, codec, keyFunction, Integer.MAX_VALUE);
}
static <B extends ByteBuf, K, V, C extends Map<K, V>> PacketCodec<B, C> map(