示例#1
0
 public boolean rotateBlock(World world, int x, int y, int z, ForgeDirection axis) {
   TileEntity tile = world.getTileEntity(x, y, z);
   if (tile instanceof TileEntityBasicBlock) {
     TileEntityBasicBlock basicTile = (TileEntityBasicBlock) tile;
     if (basicTile.canSetFacing(axis.ordinal())) {
       basicTile.setFacing((short) axis.ordinal());
       return true;
     }
   }
   return false;
 }
示例#2
0
 public ForgeDirection[] getValidRotations(World world, int x, int y, int z) {
   TileEntity tile = world.getTileEntity(x, y, z);
   ForgeDirection[] valid = new ForgeDirection[6];
   if (tile instanceof TileEntityBasicBlock) {
     TileEntityBasicBlock basicTile = (TileEntityBasicBlock) tile;
     for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
       if (basicTile.canSetFacing(dir.ordinal())) {
         valid[dir.ordinal()] = dir;
       }
     }
   }
   return valid;
 }