Registered new player state packet.
This commit is contained in:
@ -8,7 +8,7 @@ import net.minecraftforge.network.simple.SimpleChannel;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class NetworkManager {
|
public class NetworkManager {
|
||||||
private static final String VERSION = LoginProtection.MOD_ID + "1";
|
private static final String VERSION = LoginProtection.MOD_ID + "-net-1";
|
||||||
private static final Pattern NET_VERSION_PATTERN = Pattern.compile(String.format("/^%s-net-\\d+$/", LoginProtection.MOD_ID));
|
private static final Pattern NET_VERSION_PATTERN = Pattern.compile(String.format("/^%s-net-\\d+$/", LoginProtection.MOD_ID));
|
||||||
private static final Pattern MOD_VERSION_PATTERN = Pattern.compile("/^Forge-\\d+\\.\\d+\\.\\d+-\\d+\\.\\d+\\.\\d+$/");
|
private static final Pattern MOD_VERSION_PATTERN = Pattern.compile("/^Forge-\\d+\\.\\d+\\.\\d+-\\d+\\.\\d+\\.\\d+$/");
|
||||||
private static SimpleChannel channel;
|
private static SimpleChannel channel;
|
||||||
@ -28,6 +28,11 @@ public class NetworkManager {
|
|||||||
.decoder(ClientInputPacket::decode)
|
.decoder(ClientInputPacket::decode)
|
||||||
.consumer(ClientInputPacket::handle)
|
.consumer(ClientInputPacket::handle)
|
||||||
.add();
|
.add();
|
||||||
|
channel.messageBuilder(ServerPlayerStatePacket.class, id++)
|
||||||
|
.encoder(ServerPlayerStatePacket::encode)
|
||||||
|
.decoder(ServerPlayerStatePacket::decode)
|
||||||
|
.consumer(ServerPlayerStatePacket::handle)
|
||||||
|
.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void writeVersionInfo(FriendlyByteBuf buffer, boolean senderIsServer) {
|
public static void writeVersionInfo(FriendlyByteBuf buffer, boolean senderIsServer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user