示例#1
0
        public override Cuboidf[] GetSelectionBoxes(IBlockAccessor blockAccessor, BlockPos pos)
        {
            BlockEntityAnvil bea = blockAccessor.GetBlockEntity(pos) as BlockEntityAnvil;

            if (bea != null)
            {
                Cuboidf[] selectionBoxes = bea.GetSelectionBoxes(blockAccessor, pos);
                selectionBoxes[0] = this.SelectionBoxes[0];
                return(selectionBoxes);
            }

            return(base.GetSelectionBoxes(blockAccessor, pos));
        }
示例#2
0
        public override Cuboidf[] GetSelectionBoxes(IBlockAccessor blockAccessor, BlockPos pos)
        {
            BlockEntityAnvil bea = blockAccessor.GetBlockEntity(pos) as BlockEntityAnvil;

            if (bea != null)
            {
                Cuboidf[] selectionBoxes = bea.GetSelectionBoxes(blockAccessor, pos);
                float     angledeg       = Math.Abs(bea.MeshAngle * GameMath.RAD2DEG);
                selectionBoxes[0] = angledeg == 0 || angledeg == 180 ? SelectionBoxes[0] : SelectionBoxes[1];
                return(selectionBoxes);
            }

            return(base.GetSelectionBoxes(blockAccessor, pos));
        }