コード例 #1
0
 /**
  * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
  */
 public int getBlockTexture(
     IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
   if (par5 == 1) {
     return 14;
   } else if (par5 == 0) {
     return 14;
   } else {
     int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
     return par5 != var6 ? 12 : 11;
   }
 }
コード例 #2
0
ファイル: BlockMachine.java プロジェクト: blued00r/Mekanism
  @Override
  @SideOnly(Side.CLIENT)
  public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) {
    int metadata = world.getBlockMetadata(x, y, z);
    TileEntityBasicMachine tileEntity = (TileEntityBasicMachine) world.getBlockTileEntity(x, y, z);

    if (metadata == 0) {
      if (side == tileEntity.facing) {
        return isActive(world, x, y, z) ? 8 : 9;
      } else {
        return 2;
      }
    } else if (metadata == 1) {
      if (side == tileEntity.facing) {
        return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX : 14;

      } else {
        return 2;
      }
    } else if (metadata == 2) {
      if (side == tileEntity.facing) {
        return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX + 1 : 15;
      } else {
        return 2;
      }
    } else if (metadata == 3) {
      if (side == tileEntity.facing) {
        return isActive(world, x, y, z) ? 12 : 13;
      } else {
        return 2;
      }
    } else if (metadata == 4) {
      if (side == 0 || side == 1) {
        return isActive(world, x, y, z) ? 20 : 18;
      } else {
        if (side == tileEntity.facing) {
          return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX + 2 : 16;
        } else if (side
            == ForgeDirection.getOrientation(tileEntity.facing).getOpposite().ordinal()) {
          return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX + 3 : 17;
        } else {
          return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX + 4 : 19;
        }
      }
    } else {
      return 0;
    }
  }
コード例 #3
0
  /** Updates the blocks bounds based on its current state. Args: world, x, y, z */
  public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
    int var5 = var1.getBlockMetadata(var2, var3, var4);
    float var6 = 0.0F;
    float var7 = 0.0F;
    float var8 = 0.0F;
    float var9 = 1.0F;
    float var10 = 1.0F;
    float var11 = 1.0F;

    if (var5 == 0) {
      var6 = 0.2F;
      var7 = 0.2F;
      var8 = 0.45F;
      var9 = 0.8F;
      var10 = 0.8F;
      var11 = 1.0F;
    }

    if (var5 == 1) {
      var6 = 0.0F;
      var7 = 0.2F;
      var8 = 0.2F;
      var9 = 0.55F;
      var10 = 0.8F;
      var11 = 0.8F;
    }

    if (var5 == 2) {
      var6 = 0.2F;
      var7 = 0.2F;
      var8 = 0.0F;
      var9 = 0.8F;
      var10 = 0.8F;
      var11 = 0.55F;
    }

    if (var5 == 3) {
      var6 = 0.45F;
      var7 = 0.2F;
      var8 = 0.2F;
      var9 = 1.0F;
      var10 = 0.8F;
      var11 = 0.8F;
    }

    this.setBlockBounds(var6, var7, var8, var9, var10, var11);
  }
コード例 #4
0
ファイル: BlockREbench.java プロジェクト: Zerzera/ZerzeraRE
 @Override
 public int getBlockTexture(IBlockAccess iblockaccess, int x, int y, int z, int side) {
   int m = iblockaccess.getBlockMetadata(x, y, z);
   return getBlockTextureFromSideAndMetadata(side, m);
 }
コード例 #5
0
 @Override
 public boolean isPoweringTo(IBlockAccess iblockaccess, int i, int j, int k, int l) {
   return (iblockaccess.getBlockMetadata(i, j, k) & 8) > 0;
 }
コード例 #6
0
 @Override
 public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k) {
   setBlockBounds(
       0.0F, 0.0F, 0.0F, 1.0F, 0.01F + iblockaccess.getBlockMetadata(i, j, k) / 16F, 1.0F);
 }