public void ReadPacket(MinecraftStream stream) { EntityId = stream.ReadInt32(); LevelType = stream.ReadString(); GameMode = (GameMode)stream.ReadUInt8(); Dimension = (Dimension)stream.ReadInt8(); Difficulty = (Difficulty)stream.ReadUInt8(); Discarded = stream.ReadUInt8(); MaxPlayers = stream.ReadUInt8(); }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteInt32(EntityId); stream.WriteString(LevelType); stream.WriteUInt8((byte)GameMode); stream.WriteInt8((sbyte)Dimension); stream.WriteUInt8((byte)Difficulty); stream.WriteUInt8(Discarded); stream.WriteUInt8(MaxPlayers); }
public static Slot FromStream(MinecraftStream stream) { var slot = Slot.EmptySlot; slot.Id = stream.ReadInt16(); if (slot.Empty) return slot; slot.Count = stream.ReadInt8(); slot.Metadata = stream.ReadInt16(); var length = stream.ReadInt16(); if (length == -1) return slot; slot.Nbt = new NbtFile(); var buffer = stream.ReadUInt8Array(length); slot.Nbt.LoadFromBuffer(buffer, 0, length, NbtCompression.GZip, null); return slot; }
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); }
public void ReadPacket(MinecraftStream stream) { EntityId = stream.ReadInt32(); Action = (EntityAction)stream.ReadUInt8(); }
public void ReadPacket(MinecraftStream stream) { Yaw = stream.ReadSingle(); Pitch = stream.ReadSingle(); OnGround = stream.ReadBoolean(); }
public void ReadPacket(MinecraftStream stream) { EntityId = stream.ReadInt32(); Title = stream.ReadString(); X = stream.ReadInt32(); Y = stream.ReadInt32(); Z = stream.ReadInt32(); Direction = stream.ReadInt32(); }
public void ReadPacket(MinecraftStream stream) { EntityId = stream.ReadInt32(); Type = stream.ReadUInt8(); X = stream.ReadInt32(); Y = stream.ReadInt32(); Z = stream.ReadInt32(); Yaw = stream.ReadUInt8(); Pitch = stream.ReadUInt8(); HeadYaw = stream.ReadUInt8(); VelocityX = stream.ReadInt16(); VelocityY = stream.ReadInt16(); VelocityZ = stream.ReadInt16(); Metadata = MetadataDictionary.FromStream(stream); }
public void ReadPacket(MinecraftStream stream) { EntityId = stream.ReadInt32(); Type = stream.ReadUInt8(); X = stream.ReadInt32(); Y = stream.ReadInt32(); Z = stream.ReadInt32(); Yaw = stream.ReadUInt8(); Pitch = stream.ReadUInt8(); Data = stream.ReadInt32(); if (Data != 0) { SpeedX = stream.ReadInt16(); SpeedY = stream.ReadInt16(); SpeedZ = stream.ReadInt16(); } }
public void ReadPacket(MinecraftStream stream) { ItemId = stream.ReadInt32(); PlayerId = stream.ReadInt32(); }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteBoolean(OnGround); }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteInt32(X); stream.WriteUInt8(Y); stream.WriteInt32(Z); stream.WriteUInt8(Direction); HeldItem.WriteTo(stream); stream.WriteUInt8(CursorX); stream.WriteUInt8(CursorY); stream.WriteUInt8(CursorZ); }
public void ReadPacket(MinecraftStream stream) { X = stream.ReadInt32(); Y = stream.ReadUInt8(); Z = stream.ReadInt32(); Direction = stream.ReadUInt8(); HeldItem = ItemStack.FromStream(stream); CursorX = stream.ReadUInt8(); CursorY = stream.ReadUInt8(); CursorZ = stream.ReadUInt8(); }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteUInt8((byte)Action); stream.WriteInt32(X); stream.WriteUInt8(Y); stream.WriteInt32(Z); stream.WriteUInt8(Face); }
public void ReadPacket(MinecraftStream stream) { Action = (PlayerAction)stream.ReadUInt8(); X = stream.ReadInt32(); Y = stream.ReadUInt8(); Z = stream.ReadInt32(); Face = stream.ReadUInt8(); }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteDouble(X); stream.WriteDouble(Y); stream.WriteDouble(Stance); stream.WriteDouble(Z); stream.WriteSingle(Yaw); stream.WriteSingle(Pitch); stream.WriteBoolean(OnGround); }
public void ReadPacket(MinecraftStream stream) { // TODO: Investigate if Y/Stance are indeed swapped X = stream.ReadDouble(); Y = stream.ReadDouble(); Stance = stream.ReadDouble(); Z = stream.ReadDouble(); Yaw = stream.ReadSingle(); Pitch = stream.ReadSingle(); OnGround = stream.ReadBoolean(); }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteInt32(EntityId); stream.WriteUInt8((byte)Action); }
public void ReadPacket(MinecraftStream stream) { EntityId = stream.ReadInt32(); PlayerName = stream.ReadString(); X = stream.ReadInt32(); Y = stream.ReadInt32(); Z = stream.ReadInt32(); Yaw = stream.ReadUInt8(); Pitch = stream.ReadUInt8(); HeldItem = stream.ReadInt16(); Metadata = MetadataDictionary.FromStream(stream); }
public void ReadPacket(MinecraftStream stream) { SlotIndex = stream.ReadInt16(); }
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); }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteInt16(SlotIndex); }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteInt32(ItemId); stream.WriteInt32(PlayerId); }
public void ReadPacket(MinecraftStream stream) { EntityId = stream.ReadInt32(); Unknown = stream.ReadUInt8(); X = stream.ReadInt32(); Y = stream.ReadUInt8(); Z = stream.ReadInt32(); }
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); } }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteInt32(EntityId); stream.WriteUInt8(Unknown); stream.WriteInt32(X); stream.WriteUInt8(Y); stream.WriteInt32(Z); }
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); }
public void ReadPacket(MinecraftStream stream) { EntityId = stream.ReadInt32(); Animation = (AnimationType)stream.ReadUInt8(); }
public void WritePacket(MinecraftStream stream) { stream.WriteUInt8(Id); stream.WriteInt32(EntityId); stream.WriteString(Title); stream.WriteInt32(X); stream.WriteInt32(Y); stream.WriteInt32(Z); stream.WriteInt32(Direction); }
public void ReadPacket(MinecraftStream stream) { X = stream.ReadDouble(); Y = stream.ReadDouble(); Stance = stream.ReadDouble(); Z = stream.ReadDouble(); OnGround = stream.ReadBoolean(); }