public ItemCommand(short id, short metadata, Action <ItemCommand, Level, Player, BlockCoordinates> action) : base("minet:command", id, metadata) { Action = action ?? throw new ArgumentNullException(nameof(action)); Item realItem = ItemFactory.GetItem(id, metadata); NeedBlockRevert = realItem is ItemBlock; }
public ItemCommand(short id, short metadata, Action <ItemCommand, Level, Player, BlockCoordinates> action) : base(id, metadata) { Action = action; if (action == null) { throw new ArgumentNullException("action"); } Item realItem = ItemFactory.GetItem(id, metadata); NeedBlockRevert = realItem is ItemBlock; }
public override void UseItem(Level world, Player player, BlockCoordinates blockCoordinates) { if (_isUsing) { Consume(player); if (player.GameMode == GameMode.Survival || player.GameMode == GameMode.Adventure) { player.Inventory.ClearInventorySlot((byte)player.Inventory.InHandSlot); player.Inventory.SetFirstEmptySlot(ItemFactory.GetItem(374), true); } _isUsing = false; return; } _isUsing = true; }
public override Item GetSmelt() { return(ItemFactory.GetItem(364)); }