public override bool OnBlockInteractStart(IWorldAccessor world, IPlayer byPlayer, BlockSelection blockSel)
        {
            BlockEntityAnvilPart beap = world.BlockAccessor.GetBlockEntity(blockSel.Position) as BlockEntityAnvilPart;

            beap?.OnInteract(byPlayer);
            return(true);
        }
Example #2
0
        public AnvilPartRenderer(ICoreClientAPI capi, BlockEntityAnvilPart beAnvil)
        {
            this.capi    = capi;
            this.beAnvil = beAnvil;

            capi.Event.RegisterRenderer(this, EnumRenderStage.Opaque);
        }
        public override Cuboidf[] GetCollisionBoxes(IBlockAccessor world, BlockPos pos)
        {
            BlockEntityAnvilPart beap = world.GetBlockEntity(pos) as BlockEntityAnvilPart;

            if (beap?.Inventory != null && beap.Inventory[2].Empty)
            {
                return new Cuboidf[] { CollisionBoxes[0] }
            }
            ;

            return(base.GetCollisionBoxes(world, pos));
        }