public override void OnBlockInteractStop(float secondsUsed, IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel) { BlockEntityQuern beQuern = world.BlockAccessor.GetBlockEntity(blockSel.Position) as BlockEntityQuern; if (beQuern != null) { beQuern.SetPlayerGrinding(byPlayer, false); } }
public override bool OnBlockInteractCancel(float secondsUsed, IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, EnumItemUseCancelReason cancelReason) { BlockEntityQuern beQuern = world.BlockAccessor.GetBlockEntity(blockSel.Position) as BlockEntityQuern; if (beQuern != null) { beQuern.SetPlayerGrinding(byPlayer, false); } return(true); }
public override bool OnBlockInteractStart(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel) { BlockEntityQuern beQuern = world.BlockAccessor.GetBlockEntity(blockSel.Position) as BlockEntityQuern; if (beQuern != null && beQuern.CanGrind() && (blockSel.SelectionBoxIndex == 1 || beQuern.Inventory.openedByPlayerGUIds.Contains(byPlayer.PlayerUID))) { beQuern.SetPlayerGrinding(byPlayer, true); return(true); } return(base.OnBlockInteractStart(world, byPlayer, blockSel)); }
public override bool OnBlockInteractStart(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel) { if (blockSel.SelectionBoxIndex == 1) { BlockEntityQuern beQuern = world.BlockAccessor.GetBlockEntity(blockSel.Position) as BlockEntityQuern; if (beQuern != null && beQuern.CanGrind()) { beQuern.SetPlayerGrinding(byPlayer, true); return(true); } } return(base.OnBlockInteractStart(world, byPlayer, blockSel)); }