示例#1
0
        public override bool CanBlockBePlacedAtSide(World world, BlockPos blockPos, FaceSides sideHit, EntityPlayerSp placer)
        {
            if (sideHit != FaceSides.Up ||
                !(world.GetTileEntity(blockPos) is TileEntityCraftingGrid tecg))
            {
                return(true);
            }

            return(tecg.IsEmpty() && placer.IsSneaking);
        }
示例#2
0
        public override bool Equals(object obj)
        {
            if (!(obj is FaceSides))
            {
                return(false);
            }

            FaceSides sides = (FaceSides)obj;

            return(x == sides.x &&
                   y == sides.y &&
                   z == sides.z &&
                   id == sides.id &&
                   Name == sides.Name);
        }
示例#3
0
        public static bool Parse(FaceSides fs, out Facing type)
        {
            if (fs == Up)
            {
                type = Facing.up;
                return(true);
            }
            else if (fs == Down)
            {
                type = Facing.down;
                return(true);
            }
            else if (fs == North)
            {
                type = Facing.north;
                return(true);
            }
            else if (fs == South)
            {
                type = Facing.south;
                return(true);
            }
            else if (fs == East)
            {
                type = Facing.east;
                return(true);
            }
            else if (fs == West)
            {
                type = Facing.west;
                return(true);
            }

            type = Facing.up;

            return(false);
        }
示例#4
0
 public BlockPos OffsetChunk(FaceSides dir)
 {
     return(this + dir * Chunk.ChunkSize);
 }
示例#5
0
 public BlockPos Offset(FaceSides dir)
 {
     return(this + dir);
 }
示例#6
0
 public virtual bool CanBlockBePlacedAtSide(World world, BlockPos blockPos, FaceSides sideHit, EntityPlayerSp placer)
 {
     return(true);
 }