public EntityProperty(string key, double value) { Key = key; Value = value; Modifiers = new EntityPropertyListItem[0]; }
public EntityProperty(string key, double value) { Key = key; Value = value; UnknownList = new EntityPropertyListItem[0]; }
public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction) { EntityId = stream.ReadVarInt(); var count = stream.ReadInt32(); if (count < 0) throw new InvalidOperationException("Cannot specify less than zero properties."); Properties = new EntityProperty[count]; for (int i = 0; i < count; i++) { var property = new EntityProperty(); property.Key = stream.ReadString(); property.Value = stream.ReadDouble(); var listLength = stream.ReadVarInt(); property.Modifiers = new EntityPropertyListItem[listLength]; for (int j = 0; j < listLength; j++) { var item = new EntityPropertyListItem(); item.PropertUUID = new Guid(stream.ReadUInt8Array(16)); item.Amount = stream.ReadDouble(); item.Operation = stream.ReadUInt8(); property.Modifiers[j] = item; } Properties[i] = property; } return mode; }
public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction) { EntityId = stream.ReadInt32(); var count = stream.ReadInt32(); if (count < 0) throw new InvalidOperationException("Cannot specify less than zero properties."); Properties = new EntityProperty[count]; for (int i = 0; i < count; i++) { var property = new EntityProperty(); property.Key = stream.ReadString(); property.Value = stream.ReadDouble(); var listLength = stream.ReadInt16(); property.UnknownList = new EntityPropertyListItem[listLength]; for (int j = 0; j < listLength; j++) { var item = new EntityPropertyListItem(); item.UnknownMSB = stream.ReadInt64(); item.UnknownLSB = stream.ReadInt64(); item.UnknownDouble = stream.ReadDouble(); item.UnknownByte = stream.ReadUInt8(); property.UnknownList[j] = item; } Properties[i] = property; } return mode; }