Ejemplo n.º 1
0
        public bool IsFlat;                          //*

        public override void Read(byte[] array)
        {
            McInt.TryParse(ref array, out EntityId);
            McBoolean.TryParse(ref array, out IsHardcore);
            if (McUnsignedByte.TryParse(ref array, out var gamemode))
            {
                Gamemode = (Gamemodes)gamemode;
            }
            if (McByte.TryParse(ref array, out var previousGamemode))
            {
                PreviousGamemode = (Gamemodes)previousGamemode;
            }
            McVarint.TryParse(ref array, out WorldCount);
            McStringArray.TryParse(WorldCount, ref array, out WorldNames);
            McNbtCompoundTag.TryParse(ref array, out DimensionCodec);
            McNbtCompoundTag.TryParse(ref array, out Dimension);
            McString.TryParse(ref array, out WorldName);
            McLong.TryParse(ref array, out HashedSeed);
            McVarint.TryParse(ref array, out MaxPlayers);
            McVarint.TryParse(ref array, out ViewDistance);
            McBoolean.TryParse(ref array, out ReducedDebugInfo);
            McBoolean.TryParse(ref array, out EnableRespawnScreen);
            McBoolean.TryParse(ref array, out IsDebug);
            McBoolean.TryParse(ref array, out IsFlat);
        }
Ejemplo n.º 2
0
        public NbtCompoundTag NBTData; //NBT Tag


        public override void Read(byte[] array)
        {
            Location = new Position();
            Location.Read(ref array);
            McUnsignedByte.TryParse(ref array, out Action);
            McNbtCompoundTag.TryParse(ref array, out NBTData);
        }
Ejemplo n.º 3
0
 public void Parse(ref byte[] array)
 {
     McBoolean.TryParse(ref array, out Present);
     if (Present)
     {
         McVarint.TryParse(ref array, out ItemId);
         McUnsignedByte.TryParse(ref array, out ItemCount);
         McNbtCompoundTag.TryParse(ref array, out NBT);
     }
 }
Ejemplo n.º 4
0
        public bool CopyMetadata;               //*

        public override void Read(byte[] array)
        {
            McNbtCompoundTag.TryParse(ref array, out Dimension);
            McString.TryParse(ref array, out WorldName);
            McLong.TryParse(ref array, out HashedSeed);
            McUnsignedByte.TryParse(ref array, out Gamemode);
            McUnsignedByte.TryParse(ref array, out PreviousGamemode);
            McBoolean.TryParse(ref array, out IsDebug);
            McBoolean.TryParse(ref array, out IsFlat);
            McBoolean.TryParse(ref array, out CopyMetadata);
        }
Ejemplo n.º 5
0
        public override void Read(byte[] array)
        {
            McInt.TryParse(ref array, out ChunkX);             // int
            McInt.TryParse(ref array, out ChunkZ);             // int
            McBoolean.TryParse(ref array, out Fullchunk);      // bool
            McVarint.TryParse(ref array, out PrimaryBitMask);  // var int

            McNbtCompoundTag.TryParse(ref array, out Heightmaps);

            if (Fullchunk)
            {
                McVarint.TryParse(ref array, out Biomeslength);
                Biomes = new int[Biomeslength];
                for (int i = 0; i < Biomeslength; i++)
                {
                    McVarint.TryParse(ref array, out Biomes[i]);
                }
            }

            // chunk data
            McVarint.TryParse(ref array, out Size);             // size varint
            McByteArray.TryParse(Size, ref array, out Data);    // Byte array

            // BlockEntities
            McVarint.TryParse(ref array, out NumberOfBlockEntities);

            BlockEntities = new NbtCompoundTag[NumberOfBlockEntities];

            var    read1   = new NbtParser();
            Stream stream1 = new MemoryStream(array);

            for (int i = 0; i < NumberOfBlockEntities; i++)
            {
                BlockEntities[i] = read1.ParseNbtStream(stream1);
            }
        }