Exemplo n.º 1
0
        public override void OnBlockInteractStop(float secondsUsed, IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel)
        {
            BlockEntityMortarAndPestle beQuern = world.BlockAccessor.GetBlockEntity(blockSel.Position) as BlockEntityMortarAndPestle;

            if (beQuern != null)
            {
                beQuern.SetPlayerGrinding(byPlayer, false);
            }
        }
Exemplo n.º 2
0
        public override bool OnBlockInteractStep(float secondsUsed, IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel)
        {
            BlockEntityMortarAndPestle beQuern = world.BlockAccessor.GetBlockEntity(blockSel.Position) as BlockEntityMortarAndPestle;

            if (beQuern != null)
            {
                return(beQuern.CanGrind());
            }

            return(false);
        }
Exemplo n.º 3
0
        public override bool OnBlockInteractCancel(float secondsUsed, IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel, EnumItemUseCancelReason cancelReason)
        {
            BlockEntityMortarAndPestle beQuern = world.BlockAccessor.GetBlockEntity(blockSel.Position) as BlockEntityMortarAndPestle;

            if (beQuern != null)
            {
                beQuern.SetPlayerGrinding(byPlayer, false);
            }


            return(true);
        }
Exemplo n.º 4
0
        public override bool OnBlockInteractStart(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel)
        {
            if (world.BlockAccessor.GetBlock(blockSel.Position.UpCopy()).Id != 0)
            {
                return(false);
            }

            if (blockSel.SelectionBoxIndex != 4)
            {
                BlockEntityMortarAndPestle beQuern = world.BlockAccessor.GetBlockEntity(blockSel.Position) as BlockEntityMortarAndPestle;
                if (beQuern != null && beQuern.CanGrind())
                {
                    beQuern.SetPlayerGrinding(byPlayer, true);
                    return(true);
                }
            }

            return(base.OnBlockInteractStart(world, byPlayer, blockSel));
        }