public override bool OnBlockInteractStart(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel) { BEBehaviorWindmillRotor be = world.BlockAccessor.GetBlockEntity(blockSel.Position)?.GetBehavior <BEBehaviorWindmillRotor>(); if (be != null) { return(be.OnInteract(byPlayer)); } return(base.OnBlockInteractStart(world, byPlayer, blockSel)); }
public override WorldInteraction[] GetPlacedBlockInteractionHelp(IWorldAccessor world, BlockSelection selection, IPlayer forPlayer) { BEBehaviorWindmillRotor be = world.BlockAccessor.GetBlockEntity(selection.Position)?.GetBehavior <BEBehaviorWindmillRotor>(); if (be != null && be.SailLength >= 3) { return(new WorldInteraction[0]); } return(new WorldInteraction[] { new WorldInteraction() { ActionLangCode = "heldhelp-addsails", MouseButton = EnumMouseButton.Right, Itemstacks = new ItemStack[] { new ItemStack(world.GetItem(new AssetLocation("sail")), 4) } } }); }