コード例 #1
0
ファイル: Packets.cs プロジェクト: umby24/Craft.Net
 public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
 {
     ProtocolVersion = stream.ReadVarInt();
     ServerHostname = stream.ReadString();
     ServerPort = stream.ReadUInt16();
     NextState = (NetworkMode)stream.ReadVarInt();
     return NextState;
 }
コード例 #2
0
ファイル: Packets.cs プロジェクト: umby24/Craft.Net
        public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
        {
            ChunkCount = stream.ReadInt16();
            var length = stream.ReadInt32();
            LightIncluded = stream.ReadBoolean();
            ChunkData = stream.ReadUInt8Array(length);

            ChunkMetadata = new Metadata[ChunkCount];
            for (int i = 0; i < ChunkCount; i++)
            {
                var metadata = new Metadata();
                metadata.ChunkX = stream.ReadInt32();
                metadata.ChunkZ = stream.ReadInt32();
                metadata.PrimaryBitMap = stream.ReadUInt16();
                metadata.AddBitMap = stream.ReadUInt16();
                ChunkMetadata[i] = metadata;
            }
            return mode;
        }
コード例 #3
0
ファイル: Packets.cs プロジェクト: nevercast/Craft.Net
        public void ReadPacket(MinecraftStream stream)
        {
            ChunkCount = stream.ReadInt16();
            var length = stream.ReadInt32();
            LightIncluded = stream.ReadBoolean();
            ChunkData = stream.ReadUInt8Array(length);

            ChunkMetadata = new Metadata[ChunkCount];
            for (int i = 0; i < ChunkCount; i++)
            {
                var metadata = new Metadata();
                metadata.ChunkX = stream.ReadInt32();
                metadata.ChunkZ = stream.ReadInt32();
                metadata.PrimaryBitMap = stream.ReadUInt16();
                metadata.AddBitMap = stream.ReadUInt16();
                ChunkMetadata[i] = metadata;
            }
        }
コード例 #4
0
ファイル: Packets.cs プロジェクト: umby24/Craft.Net
 public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
 {
     X = stream.ReadInt32();
     Z = stream.ReadInt32();
     GroundUpContinuous = stream.ReadBoolean();
     PrimaryBitMap = stream.ReadUInt16();
     var length = stream.ReadVarInt();
     Data = stream.ReadUInt8Array(length);
     return mode;
 }
コード例 #5
0
ファイル: Packets.cs プロジェクト: nevercast/Craft.Net
 public void ReadPacket(MinecraftStream stream)
 {
     X = stream.ReadInt32();
     Z = stream.ReadInt32();
     GroundUpContinuous = stream.ReadBoolean();
     PrimaryBitMap = stream.ReadUInt16();
     AddBitMap = stream.ReadUInt16();
     var length = stream.ReadInt32();
     Data = stream.ReadUInt8Array(length);
 }