示例#1
0
 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;
 }
示例#2
0
 public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
 {
     WorldAge = stream.ReadInt64();
     TimeOfDay = stream.ReadInt64();
     return mode;
 }
示例#3
0
 public void ReadPacket(MinecraftStream stream)
 {
     WorldAge = stream.ReadInt64();
     TimeOfDay = stream.ReadInt64();
 }