public override void Decode(MinecraftStream stream) { X = stream.ReadDouble(); FeetY = stream.ReadDouble(); Z = stream.ReadDouble(); OnGround = stream.ReadBool(); }
public override void Decode(MinecraftStream stream) { EntityId = stream.ReadVarInt(); int count = stream.ReadInt(); for (int i = 0; i < count; i++) { string key = stream.ReadString(); double value = stream.ReadDouble(); int propCount = stream.ReadVarInt(); Modifier[] modifiers = new Modifier[propCount]; for (int y = 0; y < modifiers.Length; y++) { UUID uuid = new UUID(stream.ReadUuid().ToByteArray()); double amount = stream.ReadDouble(); ModifierMode op = (ModifierMode)stream.ReadByte(); modifiers[y] = EntityProperty.Factory.CreateModifier(uuid, amount, op); } EntityProperty prop = EntityProperty.Factory.Create(key, value, modifiers); if (!Properties.ContainsKey(prop.Key)) { Properties.Add(prop.Key, prop); } } }
public override void Decode(MinecraftStream stream) { X = stream.ReadDouble(); Y = stream.ReadDouble(); Z = stream.ReadDouble(); Yaw = stream.ReadFloat(); Pitch = stream.ReadFloat(); OnGround = stream.ReadBool(); }
public override void Decode(MinecraftStream stream) { X = stream.ReadDouble(); Y = stream.ReadDouble(); Z = stream.ReadDouble(); Yaw = stream.ReadFloat(); Pitch = stream.ReadFloat(); Flags = (byte)stream.ReadByte(); TeleportId = stream.ReadVarInt(); }
public override void Decode(MinecraftStream stream) { EntityID = stream.ReadVarInt(); X = stream.ReadDouble(); Y = stream.ReadDouble(); Z = stream.ReadDouble(); Yaw = (sbyte)stream.ReadByte(); Pitch = (sbyte)stream.ReadByte(); OnGround = stream.ReadBool(); }
public override void Decode(MinecraftStream stream) { EntityId = stream.ReadVarInt(); Uuid = stream.ReadUuid(); X = stream.ReadDouble(); Y = stream.ReadDouble(); Z = stream.ReadDouble(); Yaw = (sbyte)stream.ReadByte(); Pitch = (sbyte)stream.ReadByte(); stream.ReadByte(); }
public override void Decode(MinecraftStream stream) { EntityId = stream.ReadVarInt(); Uuid = stream.ReadUuid(); Type = stream.ReadVarInt(); X = stream.ReadDouble(); Y = stream.ReadDouble(); Z = stream.ReadDouble(); Yaw = (byte)stream.ReadByte(); Pitch = (byte)stream.ReadByte(); HeadPitch = (byte)stream.ReadByte(); VelocityX = stream.ReadShort(); VelocityY = stream.ReadShort(); VelocityZ = stream.ReadShort(); }
/// <inheritdoc /> public override void Decode(MinecraftStream stream) { AimWithHead = stream.ReadVarInt() == 1; var x = (float)stream.ReadDouble(); var y = (float)stream.ReadDouble(); var z = (float)stream.ReadDouble(); Target = new Vector3(x, y, z); IsEntity = stream.ReadBool(); if (IsEntity) { EntityId = stream.ReadVarInt(); LookAtEyes = stream.ReadVarInt() == 1; } }
public override Packet Read(byte[] data) { var re = new PlayerPositionAndLook(); MinecraftStream ms = new MinecraftStream(data); re.ID = ms.ReadVarInt(); re.X = ms.ReadDouble(); re.Y = ms.ReadDouble(); re.Z = ms.ReadDouble(); //re.Yaw = ms.ReadFloat(data); // re.Pitch = ms.ReadFloat(data); // re.OnGround = ms.ReadByte(data); return(re); }
public override void Decode(MinecraftStream stream) { EntityId = stream.ReadVarInt(); int count = stream.ReadInt(); for (int i = 0; i < count; i++) { Property prop = new Property(); string key = stream.ReadString(); double value = stream.ReadDouble(); int propCount = stream.ReadVarInt(); Modifier[] modifiers = new Modifier[propCount]; for (int y = 0; y < modifiers.Length; y++) { UUID uuid = new UUID(stream.ReadUuid().ToByteArray()); double amount = stream.ReadDouble(); byte op = (byte)stream.ReadByte(); modifiers[y] = new Modifier() { Amount = amount, Operation = op, Uuid = uuid }; } prop.Value = value; prop.Modifiers = modifiers; prop.Key = key; if (!Properties.ContainsKey(key)) { Properties.Add(key, prop); } } }