예제 #1
0
 public MapChunkBulkHandler(IMinecraftComHandler handler, DataTypes dataTypes, int protocolversion, Protocol18Terrain pTerrain, WorldInfo worldInfo)
 {
     this.handler         = handler;
     this.dataTypes       = dataTypes;
     this.protocolversion = protocolversion;
     this.pTerrain        = pTerrain;
     this.worldInfo       = worldInfo;
 }
 public ChunkDataHandler(IMinecraftComHandler handler, DataTypes dataTypes, Protocol18Terrain protocol18Terrain, WorldInfo worldInfo, int protocolversion)
 {
     this.handler         = handler;
     this.dataTypes       = dataTypes;
     this.pTerrain        = protocol18Terrain;
     this.worldInfo       = worldInfo;
     this.protocolversion = protocolversion;
 }
예제 #3
0
        public Protocol18PacketHandler(int protocolVersion, DataTypes dataTypes, IMinecraftComHandler handler, IPacketReadWriter packetSender, Protocol18Terrain pTerrain, Protocol18Forge pForge, WorldInfo worldInfo, Protocol18Handler protocol18Handler, Player player)
        {
            this.protocolversion = protocolVersion;

            MultiVersionHandler blockHandler = new MultiVersionHandler(protocolVersion);

            blockHandler.addPacketHandler(new BlockChangeHandler17(handler, dataTypes), (int)McVersion.V17).
            addPacketHandler(new BlockChangeHandler18(handler, dataTypes), (int)McVersion.V18);
            packetHandlers.Add(PacketIncomingType.BlockChange, blockHandler);


            packetHandlers.Add(PacketIncomingType.KeepAlive, new KeepAliveHandler(packetSender));
            packetHandlers.Add(PacketIncomingType.JoinGame, new JoinGameHandler(handler, dataTypes, worldInfo, protocolVersion));
            packetHandlers.Add(PacketIncomingType.ChatMessage, new ChatMessageHandler(handler, dataTypes));
            packetHandlers.Add(PacketIncomingType.Respawn, new RespawnHandler(handler, dataTypes, worldInfo, protocolVersion));
            packetHandlers.Add(PacketIncomingType.PlayerPositionAndLook, new PlayerPositionAndLookHandler(packetSender, dataTypes, handler, player, protocolVersion));
            packetHandlers.Add(PacketIncomingType.ChunkData, new ChunkDataHandler(handler, dataTypes, pTerrain, worldInfo, protocolVersion));
            packetHandlers.Add(PacketIncomingType.MultiBlockChange, new MultiBlockChangeHandler(handler, dataTypes, protocolVersion));

            packetHandlers.Add(PacketIncomingType.MapChunkBulk, new MapChunkBulkHandler(handler, dataTypes, protocolVersion, pTerrain, worldInfo));
            packetHandlers.Add(PacketIncomingType.UnloadChunk, new UnloadChunkHandler(handler, dataTypes, protocolVersion));
            packetHandlers.Add(PacketIncomingType.PlayerListUpdate, new PlayerListUpdateHandler(handler, dataTypes, protocolVersion));
            packetHandlers.Add(PacketIncomingType.TabCompleteResult, new TabCompleteResultHandler(handler, dataTypes, protocol18Handler, protocolVersion));
            packetHandlers.Add(PacketIncomingType.PluginMessage, new PluginMessageHandler(handler, dataTypes, pForge, worldInfo, protocolVersion));
            packetHandlers.Add(PacketIncomingType.KickPacket, new KickHandler(handler, dataTypes));
            packetHandlers.Add(PacketIncomingType.NetworkCompressionTreshold, new NetworkCompressionThresholdHandler(handler, dataTypes, protocol18Handler, protocolVersion));
            packetHandlers.Add(PacketIncomingType.OpenWindow, new OpenWindowHandler(player, dataTypes));
            packetHandlers.Add(PacketIncomingType.CloseWindow, new CloseWindowHandler(dataTypes, player));
            packetHandlers.Add(PacketIncomingType.WindowItems, new WindowItemsHandler(player, dataTypes));
            packetHandlers.Add(PacketIncomingType.ResourcePackSend, new ResourecePackSendHandler(dataTypes, packetSender, protocolVersion));
        }