Registered the ClientInputPacket. Added method to get the channel.

This commit is contained in:
2022-05-21 21:16:57 +01:00
parent a9086486fa
commit fd89f13a99

View File

@ -23,6 +23,11 @@ public class NetworkManager {
// Register packets
int id = 0;
channel.messageBuilder(ClientInputPacket.class, id++)
.encoder(ClientInputPacket::encode)
.decoder(ClientInputPacket::decode)
.consumer(ClientInputPacket::handle)
.add();
}
public static void writeVersionInfo(FriendlyByteBuf buffer, boolean senderIsServer) {
@ -61,4 +66,8 @@ public class NetworkManager {
}
return modVersion;
}
public static SimpleChannel getChannel() {
return channel;
}
}