Пример #1
0
        public Furnace(int CX, int CY, int CS, LibNbt.Tags.NbtCompound c)
            : base(CX, CY, CS, c)
        {
            BurnTime = (c["BurnTime"] as NbtShort).Value;
            CookTime = (c["CookTime"] as NbtShort).Value;

            for (int i = 0; i < Slots.Length; i++)
            {
                    try
                    {
                        if ((c["Items"] as NbtList).Tags[i]!=null)
                        {
                            NbtCompound cc = (NbtCompound)(c["Items"] as NbtList).Tags[i];
                            Slots[i] = new InventoryItem();
                            Slots[i].ID = cc.Get<NbtShort>("id").Value;
                            Slots[i].Damage = cc.Get<NbtShort>("Damage").Value;
                            Slots[i].Slot = 0;
                            Slots[i].Count = cc.Get<NbtByte>("Count").Value;

                        }
                    }
                    catch (Exception)
                    {
                    }
            }
        }
Пример #2
0
 public Sign(LibNbt.Tags.NbtCompound c)
     : base(c)
 {
     for (int i = 0; i < 4; i++)
     {
         string tagID = string.Format("Text{0}", i + 1);
         Text[i] = c.Get<NbtString>(tagID).Value;
     }
 }
Пример #3
0
 public Chest(int CX, int CY, int CS, LibNbt.Tags.NbtCompound c)
     : base(CX, CY, CS, c)
 {
     foreach (NbtCompound item in (c["Items"] as NbtList).Tags)
     {
         //NbtCompound item = (NbtCompound)itm;
         Inventory.Add(item);
     }
 }
Пример #4
0
 public Chest(LibNbt.Tags.NbtCompound c)
     : base(c)
 {
     for(int i =0;i<54;i++)
     {
         try
         {
             NbtCompound item = (NbtCompound)(c["Items"] as NbtList)[i];
             Inventory.Add(item);
         }
         catch (Exception)
         {
         }
     }
 }
Пример #5
0
 public Vector3d(LibNbt.Tags.NbtList nbtList,bool flipYZ=false)
 {
     this.X = (nbtList[0] as NbtDouble).Value;
     double _Y = (nbtList[1] as NbtDouble).Value;
     double _Z = (nbtList[2] as NbtDouble).Value;
     if (flipYZ)
     {
         this.Z = _Y;
         this.Y = _Z;
     }
     else
     {
         this.Y = _Y;
         this.Z = _Z;
     }
 }
Пример #6
0
 public MobSpawner(int CX, int CY, int CS, LibNbt.Tags.NbtCompound c)
     : base(CX, CY, CS, c)
 {
     EntityId=(c["EntityId"] as NbtString).Value;
     Delay = (c["Delay"] as NbtShort).Value;
 }
Пример #7
0
 public MobSpawner(LibNbt.Tags.NbtCompound c)
     : base(c)
 {
     EntityId=(c["EntityId"] as NbtString).Value;
     Delay = (c["Delay"] as NbtShort).Value;
 }
Пример #8
0
 public Vector3d(LibNbt.Tags.NbtList nbtList)
 {
     this.X = (nbtList[0] as NbtDouble).Value;
     this.Y = (nbtList[1] as NbtDouble).Value;
     this.Z = (nbtList[2] as NbtDouble).Value;
 }
 public void ApplyCoordinatesToPos(LibNbt.Tags.NbtList pos)
 {
     (pos[0] as LibNbt.Tags.NbtDouble).Value = this.x;
     (pos[1] as LibNbt.Tags.NbtDouble).Value = this.y;
     (pos[2] as LibNbt.Tags.NbtDouble).Value = this.z;
 }
Пример #10
0
 public Coordinates(LibNbt.Tags.NbtList pos)
 {
     x = (pos[0] as LibNbt.Tags.NbtDouble).Value;
     y = (pos[1] as LibNbt.Tags.NbtDouble).Value;
     z = (pos[2] as LibNbt.Tags.NbtDouble).Value;
 }