예제 #1
0
 internal BlockTallGrass()
     : base(31)
 {
     Metadata = 1;
     IsSolid = false;
     Drops = new ItemStack[] { new ItemWheatSeeds().GetItemStack() };
 }
예제 #2
0
        public ItemEntity(Level level, ItemStack item)
            : base(2, level)
        {
            Item = item;

            Height = 0.25;
            Width = 0.25;
            Length = 0.25;

            PickupDelay = 10;
            TimeToLive = 20*(5*60);
        }
예제 #3
0
 internal DoubleSlab(byte metadata)
     : base(43)
 {
     Metadata = metadata;
     Drops = new ItemStack[] { new ItemStack(44, 2, metadata) };
 }
예제 #4
0
 public void SetSlot(int slot, short itemId, byte metadata, byte itemcount)
 {
     if (slot <= 45 && slot >= 5)
     {
         _slots[slot] = new ItemStack(itemId, itemcount, metadata);
         if (_player != null && _player.IsSpawned)
         {
             new SetSlot(_player.Wrapper)
             {
                 WindowId = 0,
                 ItemId = itemId,
                 ItemCount = itemcount,
                 MetaData = metadata,
                 ItemDamage = 0,
                 Slot = (short) slot
             }.Write();
         }
     }
     UpdateHandItems();
 }
예제 #5
0
        public void Import(byte[] data)
        {
            DataBuffer buffer = new DataBuffer(data);

            for (int i = 0; i <= 45; i++)
            {
                int slotId = buffer.ReadInt();
                short itemId = buffer.ReadShort();
                byte metaData = (byte)buffer.ReadByte();
                byte itemCount = (byte)buffer.ReadByte();

                _slots[slotId] = new ItemStack(itemId, itemCount, metaData);
                UpdateHandItems();
            }
        }
예제 #6
0
 public bool HasItems(ItemStack[] items)
 {
     foreach (var item in items)
     {
         if (!HasItem(item.ItemId)) return false;
     }
     return true;
 }
예제 #7
0
 public bool AddItem(ItemStack item)
 {
     return AddItem(item.ItemId, item.MetaData, item.ItemCount);
 }
예제 #8
0
 internal BlockStone()
     : base(1)
 {
     Drops = new ItemStack[] {new ItemStack(new BlockCobbleStone(), 1), };
 }