Registered the ClientInputPacket. Added method to get the channel.

This commit is contained in:
2022-05-21 21:16:57 +01:00
parent bdd67eae02
commit 83f5423b92

View File

@ -23,6 +23,11 @@ public class NetworkManager {
// Register packets // Register packets
int id = 0; 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) { public static void writeVersionInfo(FriendlyByteBuf buffer, boolean senderIsServer) {
@ -61,4 +66,8 @@ public class NetworkManager {
} }
return modVersion; return modVersion;
} }
public static SimpleChannel getChannel() {
return channel;
}
} }