internal BlockTallGrass() : base(31) { Metadata = 1; IsSolid = false; Drops = new ItemStack[] { new ItemWheatSeeds().GetItemStack() }; }
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); }
internal DoubleSlab(byte metadata) : base(43) { Metadata = metadata; Drops = new ItemStack[] { new ItemStack(44, 2, metadata) }; }
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(); }
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(); } }
public bool HasItems(ItemStack[] items) { foreach (var item in items) { if (!HasItem(item.ItemId)) return false; } return true; }
public bool AddItem(ItemStack item) { return AddItem(item.ItemId, item.MetaData, item.ItemCount); }
internal BlockStone() : base(1) { Drops = new ItemStack[] {new ItemStack(new BlockCobbleStone(), 1), }; }