示例#1
0
 public override bool OnHeldAttackStep(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel)
 {
     if (notslaughtering && entitySel != null)
     {
         Entity entity = entitySel.Entity;
         if (entity.HasBehavior("slaughterable"))
         {
             return(HandAnimations.Slaughter(byEntity, secondsPassed));
         }
     }
     return(false);
 }
示例#2
0
        public override bool OnBlockInteractStep(float secondsUsed, IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel)
        {
            ItemSlot slot = byPlayer.InventoryManager.ActiveHotbarSlot;

            if (slot.Itemstack != null)
            {
                if (slot.Itemstack.Collectible.FirstCodePart() == "tamper")
                {
                    return(HandAnimations.Hit(byPlayer.Entity, secondsUsed));
                }
            }
            return(false);
        }
示例#3
0
        public override bool OnBlockInteractStep(float secondsUsed, IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel)
        {
            ItemSlot slot = byPlayer.InventoryManager.ActiveHotbarSlot;

            if (slot.Itemstack != null)
            {
                if (IsSettingHammer(slot))
                {
                    return(HandAnimations.Hit(byPlayer.Entity, secondsUsed));
                }
            }
            return(false);
        }
示例#4
0
        public override bool OnHeldInteractStep(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel)
        {
            if (blockSelection == null || slot.Itemstack.Collectible.Variant["contents"] == "curds" || slot.Itemstack.Collectible.Variant["contents"] == "cheese")
            {
                return(false);
            }
            Block selBlock = api.World.BlockAccessor.GetBlock(blockSelection.Position);

            if (selBlock is BlockBucket)
            {
                return(HandAnimations.Collect(byEntity, secondsPassed));
            }
            return(false);
        }