public static ItemStack FromReader(IMinecraftDataReader reader) { var itemStack = new ItemStack(reader.ReadShort()); // -- ID if (itemStack.ID == -1 || itemStack.Count == -1) { return(EmptyStack); } itemStack.Count = reader.ReadSByte(); itemStack.Damage = reader.ReadShort(); var length = reader.ReadVarInt(); if (length == -1 || length == 0) { return(itemStack); } itemStack.NBTData = reader.ReadByteArray(length); // TODO: NBTTag reading return(itemStack); }
public static ItemStackList FromReader(IMinecraftDataReader reader) { var value = new ItemStackList(); var count = reader.ReadShort(); for (int i = 0; i < count; i++) { var slot = new ItemStack(reader.ReadShort()); // -- ID if (slot.ID == -1 || slot.Count == -1) { value[i] = ItemStack.EmptyStack; break; } slot.Count = reader.ReadSByte(); slot.Damage = reader.ReadShort(); var length = reader.ReadVarInt(); if (length == -1) { value[i] = slot; break; } slot.NBTData = reader.ReadByteArray(length); } return(value); }
public static Coordinates2D FromReaderShort(IMinecraftDataReader reader) { return(new Coordinates2D ( reader.ReadShort(), reader.ReadShort() )); }
public IPacket ReadPacket(IMinecraftDataReader reader) { WindowId = reader.ReadByte(); PropertyId = reader.ReadShort(); Value = reader.ReadShort(); return(this); }
public static Vector3 FromReaderShort(IMinecraftDataReader reader) { return(new Vector3( reader.ReadShort(), reader.ReadShort(), reader.ReadShort() )); }
public static Position FromReaderShort(IMinecraftDataReader reader) { return(new Position ( reader.ReadShort(), reader.ReadShort(), reader.ReadShort() )); }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { Variable = (EnvironmentalVariable)reader.ReadByte(); Red = reader.ReadShort(); Green = reader.ReadShort(); Blue = reader.ReadShort(); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); VelocityX = reader.ReadShort(); VelocityY = reader.ReadShort(); VelocityZ = reader.ReadShort(); return this; }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { Variable = (EnvironmentalVariable) reader.ReadByte(); Red = reader.ReadShort(); Green = reader.ReadShort(); Blue = reader.ReadShort(); return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); VelocityX = reader.ReadShort(); VelocityY = reader.ReadShort(); VelocityZ = reader.ReadShort(); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { WindowID = reader.ReadByte(); Slot = reader.ReadShort(); Button = reader.ReadByte(); ActionNumber = reader.ReadShort(); Mode = reader.ReadByte(); ClickedItem = ItemStack.FromReader(reader); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { WindowID = reader.ReadByte(); Slot = reader.ReadShort(); Button = reader.ReadByte(); ActionNumber = reader.ReadShort(); Mode = reader.ReadByte(); ClickedItem = ItemStack.FromReader(reader); return this; }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { SelectionID = reader.ReadByte(); Label = reader.ReadString(); StartLocation = Position.FromReaderShort(reader); EndLocation = Position.FromReaderShort(reader); Red = reader.ReadShort(); Green = reader.ReadShort(); Blue = reader.ReadShort(); Opacity = reader.ReadShort(); return(this); }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { SelectionID = reader.ReadByte(); Label = reader.ReadString(); StartLocation = Position.FromReaderShort(reader); EndLocation = Position.FromReaderShort(reader); Red = reader.ReadShort(); Green = reader.ReadShort(); Blue = reader.ReadShort(); Opacity = reader.ReadShort(); return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); Type = (Mobs) reader.ReadByte(); Vector3 = Vector3.FromReaderIntFixedPoint(reader); Yaw = reader.ReadSByte(); Pitch = reader.ReadSByte(); HeadPitch = reader.ReadSByte(); VelocityX = reader.ReadShort(); VelocityY = reader.ReadShort(); VelocityZ = reader.ReadShort(); EntityMetadata = EntityMetadataList.FromReader(reader); return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); Type = (Mobs)reader.ReadByte(); Vector3 = Vector3.FromReaderIntFixedPoint(reader); Yaw = reader.ReadSByte(); Pitch = reader.ReadSByte(); HeadPitch = reader.ReadSByte(); VelocityX = reader.ReadShort(); VelocityY = reader.ReadShort(); VelocityZ = reader.ReadShort(); EntityMetadata = EntityMetadataList.FromReader(reader); return(this); }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { AppName = reader.ReadString(); ExtensionCount = reader.ReadShort(); return this; }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { AppName = reader.ReadString(); ExtensionCount = reader.ReadShort(); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { Slot = reader.ReadShort(); ClickedItem = ItemStack.FromReader(reader); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); Vector3 = Vector3.FromReaderIntFixedPoint(reader); Count = reader.ReadShort(); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); Slot = (EntityEquipmentSlot)reader.ReadShort(); Item = ItemStack.FromReader(reader); return(this); }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { ChunkLength = reader.ReadShort(); ChunkData = reader.ReadByteArray(1024); PercentComplete = reader.ReadByte(); return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); Type = (Objects) reader.ReadByte(); Vector3 = Vector3.FromReaderIntFixedPoint(reader); Yaw = reader.ReadByte(); Pitch = reader.ReadByte(); var data = reader.ReadInt(); if (data > 0) { SpeedX = reader.ReadShort(); SpeedY = reader.ReadShort(); SpeedZ = reader.ReadShort(); } return this; }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { ChunkLength = reader.ReadShort(); ChunkData = reader.ReadByteArray(1024); PercentComplete = reader.ReadByte(); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); Vector3 = Vector3.FromReaderIntFixedPoint(reader); Count = reader.ReadShort(); return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { WindowId = reader.ReadSByte(); Slot = reader.ReadShort(); SlotData = ItemStack.FromReader(reader); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { WindowID = reader.ReadByte(); Slot = reader.ReadShort(); Accepted = reader.ReadBoolean(); return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { WindowId = reader.ReadByte(); ActionNumber = reader.ReadShort(); Accepted = reader.ReadBoolean(); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); Slot = (EntityEquipmentSlot) reader.ReadShort(); Item = ItemStack.FromReader(reader); return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { WindowId = reader.ReadSByte(); Slot = reader.ReadShort(); SlotData = ItemStack.FromReader(reader); return this; }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { TextureURL = reader.ReadString(); SideBlock = reader.ReadByte(); EdgeBlock = reader.ReadByte(); SideLevel = reader.ReadShort(); return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); Type = (Objects)reader.ReadByte(); Vector3 = Vector3.FromReaderIntFixedPoint(reader); Yaw = reader.ReadByte(); Pitch = reader.ReadByte(); var data = reader.ReadInt(); if (data > 0) { SpeedX = reader.ReadShort(); SpeedY = reader.ReadShort(); SpeedZ = reader.ReadShort(); } return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { ProtocolVersion = reader.ReadVarInt(); ServerAddress = reader.ReadString(); ServerPort = reader.ReadShort(); NextState = (NextState)reader.ReadVarInt(); return(this); }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { TextureURL = reader.ReadString(); SideBlock = reader.ReadByte(); EdgeBlock = reader.ReadByte(); SideLevel = reader.ReadShort(); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { Channel = reader.ReadString(); int length = reader.ReadShort(); Data = reader.ReadByteArray(length); return(this); }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { NameID = reader.ReadShort(); PlayerName = reader.ReadString(); ListName = reader.ReadString(); GroupName = reader.ReadString(); GroupRank = reader.ReadByte(); return(this); }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { Flying = (Flying) reader.ReadByte(); NoClip = (NoClip) reader.ReadByte(); Speeding = (Speeding) reader.ReadByte(); SpawnControl = (SpawnControl) reader.ReadByte(); ThirdPersonView = (ThirdPersonView) reader.ReadByte(); JumpHeight = reader.ReadShort(); return this; }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { Flying = (Flying)reader.ReadByte(); NoClip = (NoClip)reader.ReadByte(); Speeding = (Speeding)reader.ReadByte(); SpawnControl = (SpawnControl)reader.ReadByte(); ThirdPersonView = (ThirdPersonView)reader.ReadByte(); JumpHeight = reader.ReadShort(); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); PlayerUUID = reader.ReadBigInteger(); Vector3 = Vector3.FromReaderIntFixedPoint(reader); Yaw = reader.ReadSByte(); Pitch = reader.ReadSByte(); CurrentItem = reader.ReadShort(); EntityMetadata = EntityMetadataList.FromReader(reader); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { EntityID = reader.ReadVarInt(); PlayerUUID = reader.ReadBigInteger(); Vector3 = Vector3.FromReaderIntFixedPoint(reader); Yaw = reader.ReadSByte(); Pitch = reader.ReadSByte(); CurrentItem = reader.ReadShort(); EntityMetadata = EntityMetadataList.FromReader(reader); return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { ItemDamage = reader.ReadVarInt(); Scale = reader.ReadSByte(); IconList = IconList.FromReader(reader); Columns = reader.ReadSByte(); if (Columns > 0) { Rows = reader.ReadSByte(); X = reader.ReadSByte(); Y = reader.ReadSByte(); var dataLength = reader.ReadShort(); Data = reader.ReadByteArray(dataLength); } return this; }
public IPacket ReadPacket(IMinecraftDataReader reader) { ItemDamage = reader.ReadVarInt(); Scale = reader.ReadSByte(); IconList = IconList.FromReader(reader); Columns = reader.ReadSByte(); if (Columns > 0) { Rows = reader.ReadSByte(); X = reader.ReadSByte(); Y = reader.ReadSByte(); var dataLength = reader.ReadShort(); Data = reader.ReadByteArray(dataLength); } return(this); }
public static RecordList FromReader(IMinecraftDataReader reader) { var value = new RecordList(); var count = reader.ReadVarInt(); for (int i = 0; i < count; i++) { var record = new Record(); var coordinates = reader.ReadShort(); var y = coordinates & 0xFF; var z = (coordinates >> 8) & 0xf; var x = (coordinates >> 12) & 0xf; record.BlockIDMeta = reader.ReadVarInt(); record.Coordinates = new Position(x, y, z); value[i] = record; } return(value); }
public static RecordList FromReader(IMinecraftDataReader reader) { var value = new RecordList(); var count = reader.ReadVarInt(); for (int i = 0; i < count; i++) { var record = new Record(); var coordinates = reader.ReadShort(); var y = coordinates & 0xFF; var z = (coordinates >> 8) & 0xf; var x = (coordinates >> 12) & 0xf; record.BlockIDMeta = reader.ReadVarInt(); record.Coordinates = new Position(x, y, z); value[i] = record; } return value; }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { Distance = reader.ReadShort(); return(this); }
public IPacket ReadPacket(IMinecraftDataReader reader) { Slot = reader.ReadShort(); return(this); }
public override void FromReader(IMinecraftDataReader reader) { Value = reader.ReadShort(); }
public IPacketWithSize ReadPacket(IMinecraftDataReader reader) { Distance = reader.ReadShort(); return this; }
public override void FromReader(IMinecraftDataReader reader) { Value = reader.ReadShort(); }
public IPacket ReadPacket(IMinecraftDataReader reader) { Slot = reader.ReadShort(); return this; }