예제 #1
0
        /// <summary>
        /// Registers all built-in packet handlers.
        /// </summary>
        public static void RegisterHandlers()
        {
            MinecraftClient.RegisterPacketHandler(EncryptionKeyRequestPacket.PacketId, LoginHandlers.EncryptionKeyRequest);
            MinecraftClient.RegisterPacketHandler(EncryptionKeyResponsePacket.PacketId, LoginHandlers.EncryptionKeyResponse);
            MinecraftClient.RegisterPacketHandler(LoginRequestPacket.PacketId, LoginHandlers.LoginRequest);
            MinecraftClient.RegisterPacketHandler(DisconnectPacket.PacketId, LoginHandlers.Disconnect);

            MinecraftClient.RegisterPacketHandler(PlayerPositionAndLookPacket.PacketId, EntityHandlers.PlayerPositionAndLook);

            MinecraftClient.RegisterPacketHandler(KeepAlivePacket.PacketId, KeepAlive);
            MinecraftClient.RegisterPacketHandler(ChatMessagePacket.PacketId, ChatHandler.ChatMessage);

            MinecraftClient.RegisterPacketHandler(UpdateHealthPacket.PacketId, StateHandlers.UpdateHealth);
            MinecraftClient.RegisterPacketHandler(RespawnPacket.PacketId, StateHandlers.Respawn);

            MinecraftClient.RegisterPacketHandler(MapChunkBulkPacket.PacketId, WorldHandlers.MapChunkBulk);
            MinecraftClient.RegisterPacketHandler(ChunkDataPacket.PacketId, WorldHandlers.ChunkData);
            MinecraftClient.RegisterPacketHandler(UpdateSignPacket.PacketId, WorldHandlers.UpdateSign);
        }
예제 #2
0
        public static void Register(MinecraftClient client)
        {
            client.RegisterPacketHandler(typeof(EncryptionKeyRequestPacket), LoginHandlers.EncryptionKeyRequest);
            client.RegisterPacketHandler(typeof(LoginSuccessPacket), LoginHandlers.LoginSuccess);
            client.RegisterPacketHandler(typeof(JoinGamePacket), LoginHandlers.JoinGame);
            client.RegisterPacketHandler(typeof(DisconnectPacket), LoginHandlers.Disconnect);

            client.RegisterPacketHandler(typeof(PlayerPositionAndLookPacket), EntityHandlers.PlayerPositionAndLook);

            client.RegisterPacketHandler(typeof(KeepAlivePacket), KeepAlive);
            client.RegisterPacketHandler(typeof(ChatMessagePacket), ChatHandler.ChatMessage);

            client.RegisterPacketHandler(typeof(UpdateHealthPacket), StateHandlers.UpdateHealth);
            client.RegisterPacketHandler(typeof(RespawnPacket), StateHandlers.Respawn);

            client.RegisterPacketHandler(typeof(MapChunkBulkPacket), WorldHandlers.MapChunkBulk);
            client.RegisterPacketHandler(typeof(ChunkDataPacket), WorldHandlers.ChunkData);
            client.RegisterPacketHandler(typeof(BlockChangePacket), WorldHandlers.BlockChange);
        }
예제 #3
0
        public static void Register(MinecraftClient client)
        {
            client.RegisterPacketHandler(EncryptionKeyRequestPacket.PacketId, LoginHandlers.EncryptionKeyRequest);
            client.RegisterPacketHandler(EncryptionKeyResponsePacket.PacketId, LoginHandlers.EncryptionKeyResponse);
            client.RegisterPacketHandler(LoginRequestPacket.PacketId, LoginHandlers.LoginRequest);
            client.RegisterPacketHandler(DisconnectPacket.PacketId, LoginHandlers.Disconnect);

            client.RegisterPacketHandler(PlayerPositionAndLookPacket.PacketId, EntityHandlers.PlayerPositionAndLook);

            client.RegisterPacketHandler(KeepAlivePacket.PacketId, KeepAlive);
            client.RegisterPacketHandler(ChatMessagePacket.PacketId, ChatHandler.ChatMessage);

            client.RegisterPacketHandler(UpdateHealthPacket.PacketId, StateHandlers.UpdateHealth);
            client.RegisterPacketHandler(RespawnPacket.PacketId, StateHandlers.Respawn);

            client.RegisterPacketHandler(MapChunkBulkPacket.PacketId, WorldHandlers.MapChunkBulk);
            client.RegisterPacketHandler(ChunkDataPacket.PacketId, WorldHandlers.ChunkData);
        }