Exemplo n.º 1
0
 public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
   if (l == 1) {
     return 78;
   }
   if (l == 0) {
     return 2;
   }
   Material material = iblockaccess.getBlockMaterial(i, j + 1, k);
   return material != Material.snow && material != Material.craftedSnow ? 77 : 68;
 }
Exemplo n.º 2
0
 /**
  * Returns true if the given side of this block type should be rendered, if the adjacent block is
  * at the given coordinates. Args: blockAccess, x, y, z, side
  */
 public boolean shouldSideBeRendered(
     IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
   Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4);
   return var6 == this.blockMaterial
       ? false
       : (par5 == 1
           ? true
           : (var6 == Material.ice
               ? false
               : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5)));
 }
Exemplo n.º 3
0
 /**
  * Returns Returns true if the given side of this block type should be rendered (if it's solid or
  * not), if the adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side
  */
 public boolean isBlockSolid(
     IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
   Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4);
   return var6 == this.blockMaterial
       ? false
       : (par5 == 1
           ? true
           : (var6 == Material.ice
               ? false
               : super.isBlockSolid(par1IBlockAccess, par2, par3, par4, par5)));
 }
Exemplo n.º 4
0
  /**
   * Returns the flow decay but converts values indicating falling liquid (values >=8) to their
   * effective source block value of zero.
   */
  protected int getEffectiveFlowDecay(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
    if (par1IBlockAccess.getBlockMaterial(par2, par3, par4) != this.blockMaterial) {
      return -1;
    } else {
      int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);

      if (var5 >= 8) {
        var5 = 0;
      }

      return var5;
    }
  }
Exemplo n.º 5
0
  /** Returns a vector indicating the direction and intensity of fluid flow. */
  private Vec3 getFlowVector(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
    Vec3 var5 = Vec3.getVec3Pool().getVecFromPool(0.0D, 0.0D, 0.0D);
    int var6 = this.getEffectiveFlowDecay(par1IBlockAccess, par2, par3, par4);

    for (int var7 = 0; var7 < 4; ++var7) {
      int var8 = par2;
      int var10 = par4;

      if (var7 == 0) {
        var8 = par2 - 1;
      }

      if (var7 == 1) {
        var10 = par4 - 1;
      }

      if (var7 == 2) {
        ++var8;
      }

      if (var7 == 3) {
        ++var10;
      }

      int var11 = this.getEffectiveFlowDecay(par1IBlockAccess, var8, par3, var10);
      int var12;

      if (var11 < 0) {
        if (!par1IBlockAccess.getBlockMaterial(var8, par3, var10).blocksMovement()) {
          var11 = this.getEffectiveFlowDecay(par1IBlockAccess, var8, par3 - 1, var10);

          if (var11 >= 0) {
            var12 = var11 - (var6 - 8);
            var5 =
                var5.addVector(
                    (double) ((var8 - par2) * var12),
                    (double) ((par3 - par3) * var12),
                    (double) ((var10 - par4) * var12));
          }
        }
      } else if (var11 >= 0) {
        var12 = var11 - var6;
        var5 =
            var5.addVector(
                (double) ((var8 - par2) * var12),
                (double) ((par3 - par3) * var12),
                (double) ((var10 - par4) * var12));
      }
    }

    if (par1IBlockAccess.getBlockMetadata(par2, par3, par4) >= 8) {
      boolean var13 = false;

      if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3, par4 - 1, 2)) {
        var13 = true;
      }

      if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3, par4 + 1, 3)) {
        var13 = true;
      }

      if (var13 || this.isBlockSolid(par1IBlockAccess, par2 - 1, par3, par4, 4)) {
        var13 = true;
      }

      if (var13 || this.isBlockSolid(par1IBlockAccess, par2 + 1, par3, par4, 5)) {
        var13 = true;
      }

      if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3 + 1, par4 - 1, 2)) {
        var13 = true;
      }

      if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3 + 1, par4 + 1, 3)) {
        var13 = true;
      }

      if (var13 || this.isBlockSolid(par1IBlockAccess, par2 - 1, par3 + 1, par4, 4)) {
        var13 = true;
      }

      if (var13 || this.isBlockSolid(par1IBlockAccess, par2 + 1, par3 + 1, par4, 5)) {
        var13 = true;
      }

      if (var13) {
        var5 = var5.normalize().addVector(0.0D, -6.0D, 0.0D);
      }
    }

    var5 = var5.normalize();
    return var5;
  }