Example #1
0
 public void WriteTo(MinecraftStream stream)
 {
     stream.WriteInt16(Id);
     if (Empty)
         return;
     stream.WriteInt8(Count);
     stream.WriteInt16(Metadata);
     if (Nbt == null)
     {
         stream.WriteInt16(-1);
         return;
     }
     var mStream = new MemoryStream();
     Nbt.SaveToStream(mStream, NbtCompression.GZip);
     var buffer = mStream.GetBuffer();
     stream.WriteInt16((short)buffer.Length);
     stream.WriteUInt8Array(buffer);
 }
Example #2
0
        public void WriteTo(MinecraftStream stream)
        {
            stream.WriteInt16(Id);
            if (Empty)
            {
                return;
            }
            stream.WriteInt8(Count);
            stream.WriteInt16(Metadata);
            if (Nbt == null)
            {
                stream.WriteInt16(-1);
                return;
            }
            var mStream = new MemoryStream();

            Nbt.SaveToStream(mStream, NbtCompression.GZip);
            var buffer = mStream.GetBuffer();

            stream.WriteInt16((short)buffer.Length);
            stream.WriteUInt8Array(buffer);
        }
Example #3
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(EntityId);
     stream.WriteUInt8(Type);
     stream.WriteInt32(X);
     stream.WriteInt32(Y);
     stream.WriteInt32(Z);
     stream.WriteUInt8(Yaw);
     stream.WriteUInt8(Pitch);
     stream.WriteInt32(Data);
     if (Data != 0)
     {
         stream.WriteInt16(SpeedX.Value);
         stream.WriteInt16(SpeedY.Value);
         stream.WriteInt16(SpeedZ.Value);
     }
 }
Example #4
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt16(SlotIndex);
 }
Example #5
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt16(Health);
     stream.WriteInt16(Food);
     stream.WriteSingle(FoodSaturation);
 }
Example #6
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt16((short)SharedSecret.Length);
     stream.WriteUInt8Array(SharedSecret);
     stream.WriteInt16((short)VerificationToken.Length);
     stream.WriteUInt8Array(VerificationToken);
 }
Example #7
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(PacketId);
     stream.WriteString(TeamName);
     stream.WriteUInt8((byte)PacketMode);
     if (PacketMode == TeamMode.CreateTeam || PacketMode == TeamMode.UpdateTeam)
     {
         stream.WriteString(DisplayName);
         stream.WriteString(TeamPrefix);
         stream.WriteString(TeamSuffix);
         stream.WriteBoolean(EnableFriendlyFire.Value);
     }
     if (PacketMode == TeamMode.CreateTeam || PacketMode == TeamMode.AddPlayers ||
         PacketMode == TeamMode.RemovePlayers)
     {
         stream.WriteInt16((short)Players.Length);
         for (int i = 0; i < Players.Length; i++)
             stream.WriteString(Players[i]);
     }
 }
Example #8
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(X);
     stream.WriteInt16(Y);
     stream.WriteInt32(Z);
     stream.WriteUInt8(Action);
     var tempStream = new MemoryStream();
     Nbt.SaveToStream(tempStream, NbtCompression.GZip);
     var buffer = tempStream.GetBuffer();
     stream.WriteInt16((short)buffer.Length);
     stream.WriteUInt8Array(buffer);
 }
Example #9
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(X);
     stream.WriteInt16(Y);
     stream.WriteInt32(Z);
     stream.WriteString(Text1);
     stream.WriteString(Text2);
     stream.WriteString(Text3);
     stream.WriteString(Text4);
 }
Example #10
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(ChunkX);
     stream.WriteInt32(ChunkZ);
     stream.WriteInt16(RecordCount);
     stream.WriteInt32(RecordCount * 4);
     stream.WriteInt32Array(Data);
 }
Example #11
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteSingle(ExperienceBar);
     stream.WriteInt16(Level);
     stream.WriteInt16(TotalExperience);
 }
Example #12
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(EntityId);
     stream.WriteUInt8(EffectId);
     stream.WriteUInt8(Amplifier);
     stream.WriteInt16(Duration);
 }
Example #13
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(EntityId);
     stream.WriteInt16(VelocityX);
     stream.WriteInt16(VelocityY);
     stream.WriteInt16(VelocityZ);
 }
Example #14
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(EntityId);
     stream.WriteInt32(X);
     stream.WriteInt32(Y);
     stream.WriteInt32(Z);
     stream.WriteInt16(Count);
 }
Example #15
0
        public void WritePacket(MinecraftStream stream)
        {
            stream.WriteUInt8(Id);
            stream.WriteInt16(ChunkCount);
            stream.WriteInt32(ChunkData.Length);
            stream.WriteBoolean(LightIncluded);
            stream.WriteUInt8Array(ChunkData);

            for (int i = 0; i < ChunkCount; i++)
            {
                stream.WriteInt32(ChunkMetadata[i].ChunkX);
                stream.WriteInt32(ChunkMetadata[i].ChunkZ);
                stream.WriteUInt16(ChunkMetadata[i].PrimaryBitMap);
                stream.WriteUInt16(ChunkMetadata[i].AddBitMap);
            }
        }
Example #16
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteUInt8(WindowId);
     stream.WriteInt16(ActionNumber);
     stream.WriteBoolean(Accepted);
 }
Example #17
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(X);
     stream.WriteUInt8(Y);
     stream.WriteInt32(Z);
     stream.WriteInt16(BlockType);
     stream.WriteUInt8(BlockMetadata);
 }
Example #18
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt16(ItemType);
     stream.WriteInt16(ItemId);
     stream.WriteInt16((short)Text.Length);
     stream.WriteUInt8Array(Encoding.ASCII.GetBytes(Text));
 }
Example #19
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(X);
     stream.WriteInt16(Y);
     stream.WriteInt32(Z);
     stream.WriteUInt8(Data1);
     stream.WriteUInt8(Data2);
     stream.WriteInt16(BlockId);
 }
Example #20
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteString(PlayerName);
     stream.WriteBoolean(Online);
     stream.WriteInt16(Ping);
 }
Example #21
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt16(ChunkCount);
     stream.WriteInt32(ChunkData.Length);
     stream.WriteBoolean(LightIncluded);
     stream.WriteUInt8Array(ChunkData);
     stream.WriteUInt8Array(ChunkMetadata);
 }
Example #22
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteString(Channel);
     stream.WriteInt16((short)Data.Length);
     stream.WriteUInt8Array(Data);
 }
Example #23
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(EntityId);
     stream.WriteInt16((short)SlotIndex);
     Slot.WriteTo(stream);
 }
Example #24
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteString(ServerId);
     stream.WriteInt16((short)PublicKey.Length);
     stream.WriteUInt8Array(PublicKey);
     stream.WriteInt16((short)VerificationToken.Length);
     stream.WriteUInt8Array(VerificationToken);
 }
Example #25
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteUInt8(WindowId);
     stream.WriteInt16(SlotIndex);
     stream.WriteUInt8(MouseButton);
     stream.WriteInt16(ActionNumber);
     stream.WriteBoolean(Shift);
     ClickedItem.WriteTo(stream);
 }
Example #26
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32((int)Dimension);
     stream.WriteInt8((sbyte)Difficulty);
     stream.WriteInt8((sbyte)GameMode);
     stream.WriteInt16(WorldHeight);
     stream.WriteString(LevelType);
 }
Example #27
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteUInt8(WindowId);
     stream.WriteInt16(SlotIndex);
     Item.WriteTo(stream);
 }
Example #28
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(EntityId);
     stream.WriteString(PlayerName);
     stream.WriteInt32(X);
     stream.WriteInt32(Y);
     stream.WriteInt32(Z);
     stream.WriteUInt8(Yaw);
     stream.WriteUInt8(Pitch);
     stream.WriteInt16(HeldItem);
     Metadata.WriteTo(stream);
 }
Example #29
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteUInt8(WindowId);
     stream.WriteInt16((short)Items.Length);
     for (int i = 0; i < Items.Length; i++)
         Items[i].WriteTo(stream);
 }
Example #30
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteInt32(EntityId);
     stream.WriteUInt8(Type);
     stream.WriteInt32(X);
     stream.WriteInt32(Y);
     stream.WriteInt32(Z);
     stream.WriteUInt8(Yaw);
     stream.WriteUInt8(Pitch);
     stream.WriteUInt8(HeadYaw);
     stream.WriteInt16(VelocityX);
     stream.WriteInt16(VelocityY);
     stream.WriteInt16(VelocityZ);
     Metadata.WriteTo(stream);
 }
Example #31
0
 public void WritePacket(MinecraftStream stream)
 {
     stream.WriteUInt8(Id);
     stream.WriteUInt8(WindowId);
     stream.WriteInt16(PropertyId);
     stream.WriteInt16(Value);
 }