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); }
public override bool OnHeldInteractStep(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) { Block block = blockSel.Position.GetBlock(byEntity.World); if (block != null && byEntity.Controls.Sneak && (block.FirstCodePart().Contains("skinned") || block.FirstCodePart().Contains("dead"))) { return(HandAnimations.Skin(byEntity, secondsUsed)); } else { return(base.OnHeldInteractStep(secondsUsed, slot, byEntity, blockSel, entitySel)); } }
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); }
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); }
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); }
public override bool OnBlockInteractStep(float secondsUsed, IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel) { return(HandAnimations.Hit(byPlayer.Entity, secondsUsed)); }