예제 #1
0
파일: ItemCommand.cs 프로젝트: sccGg/MiNET
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
        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;
        }
예제 #4
0
파일: ItemRawBeef.cs 프로젝트: wgaox/MiNET
 public override Item GetSmelt()
 {
     return(ItemFactory.GetItem(364));
 }