Registered new packet in channel.

This commit is contained in:
2022-01-16 13:34:37 +00:00
parent b7d29ecf27
commit e6dcde1caa

View File

@ -22,6 +22,13 @@ public class Network {
.serverAcceptedVersions(s -> Objects.equals(s, VERSION))
.networkProtocolVersion(() -> VERSION)
.simpleChannel();
int id = 0;
channel.messageBuilder(UpdateRecipesPacket.class, ++id)
.encoder(UpdateRecipesPacket::encode)
.decoder(UpdateRecipesPacket::decode)
.consumer(UpdateRecipesPacket::handle)
.add();
}
public static void writeVersionInfo(PacketBuffer buffer) {