Esempio n. 1
0
  @Override
  @SideOnly(Side.CLIENT)
  public Icon getBlockTexture(IBlockAccess block, int x, int y, int z, int side) {
    int t = block.getBlockMetadata(x, y, z) & 7;
    int meta = block.getBlockMetadata(x, y, z);
    if (t == 2 || t == 3) {
      if (side == 0 || side == 1) {
        Integer worldID = Minecraft.getMinecraft().thePlayer.worldObj.provider.dimensionId;
        BlockCoord coord = new BlockCoord(x, y, z);
        ChunkCoord chunk = new ChunkCoord(coord);

        if (!ArtificeCore.textureCache.contains(worldID, chunk, coord)) {
          int[] indices = new int[6];
          for (int i = 0; i < indices.length; i++)
            indices[i] = this.getTextureRenderer(i, meta).getTextureIndex(block, x, y, z, i);
          ArtificeCore.textureCache.add(worldID, chunk, coord, indices);
        }

        if (ArtificeCore.textureCache.get(worldID, chunk, coord) == null)
          return this.getIcon(side, meta);
        return this.getTextureRenderer(side, meta)
            .texture
            .textureList[ArtificeCore.textureCache.get(worldID, chunk, coord)[side]];
      } else return this.paverSide;
    }
    if (t == 0) t = 2;
    return ArtificeBlocks.blockMarble.getIcon(side, t);
  }
  public boolean shouldSideBeRendered(
      IBlockAccess p_149646_1_,
      int p_149646_2_,
      int p_149646_3_,
      int p_149646_4_,
      int p_149646_5_) {
    Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);

    if (this == ModBlocks.IronwoodLeaves) {
      if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_)
          != p_149646_1_.getBlockMetadata(
              p_149646_2_ - Facing.offsetsXForSide[p_149646_5_],
              p_149646_3_ - Facing.offsetsYForSide[p_149646_5_],
              p_149646_4_ - Facing.offsetsZForSide[p_149646_5_])) {
        return true;
      }

      if (block == this) {
        return true;
      }
    }

    return !this.field_149996_a && block == this
        ? false
        : super.shouldSideBeRendered(
            p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
  }
  @Override
  public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) {
    int metadata = world.getBlockMetadata(x, y, z);

    if (metadata >= GCCoreBlockMachine.STORAGE_MODULE_METADATA
        && metadata < GCCoreBlockMachine.ELECTRIC_FURNACE_METADATA) {
      TileEntity tile = world.getBlockTileEntity(x, y, z);

      metadata -= GCCoreBlockMachine.STORAGE_MODULE_METADATA;

      if (side == 0 || side == 1) {
        return this.blockIcon;
      }

      // If it is the front side
      if (side == metadata + 2) {
        return this.iconOutput;
      }
      // If it is the back side
      else if (side == ForgeDirection.getOrientation(metadata + 2).getOpposite().ordinal()) {
        return this.iconInput;
      }

      if (tile instanceof GCCoreTileEntityEnergyStorageModule) {
        return this.iconEnergyStorageModule[
            ((GCCoreTileEntityEnergyStorageModule) tile).scaledEnergyLevel];
      } else {
        return this.iconEnergyStorageModule[0];
      }
    }

    return this.getIcon(side, world.getBlockMetadata(x, y, z));
  }
  @Override
  public int isProvidingWeakPower(IBlockAccess world, int i, int j, int k, int l) {
    if (!this.wiresProvidePower) {
      return 0;
    } else if (world.getBlockMetadata(i, j, k) == 0) {
      return 0;
    } else {
      boolean poweredNegX = isPoweredOrRepeater(world, i - 1, j, k, 1);
      boolean poweredPosX = isPoweredOrRepeater(world, i + 1, j, k, 3);
      boolean poweredNegZ = isPoweredOrRepeater(world, i, j, k - 1, 2);
      boolean poweredPosZ = isPoweredOrRepeater(world, i, j, k + 1, 0);
      boolean poweredNegY = isPoweredOrRepeater(world, i, j - 1, k, -1);
      boolean poweredPosY = isPoweredOrRepeater(world, i, j + 1, k, -1);

      if ((l == 2 && poweredNegZ)
          || (l == 3 && poweredPosZ)
          || (l == 4 && poweredNegX)
          || (l == 5 && poweredPosX)
          || (l == 0 && poweredNegY)
          || (l == 1 && poweredPosY)) {
        return world.getBlockMetadata(i, j, k);
      }
      return 0;
    }
  }
Esempio n. 5
0
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    if (world.getBlockMetadata(x, y, z) == 0) {
      renderer.setRenderBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.0625F, 0.9375F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.1875F, 0.0625F, 0.1875F, 0.8125F, 0.25F, 0.8125F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.4375F, 0.75F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.3125F, 0.4375F, 0.3125F, 0.6875F, 0.625F, 0.6875F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.375F, 0.625F, 0.375F, 0.625F, 0.8125F, 0.625F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.4375F, 0.8125F, 0.4375F, 0.5625F, 1F, 0.5625F);
      renderer.renderStandardBlock(block, x, y, z);
    }
    if (world.getBlockMetadata(x, y, z) == 1) {
      renderer.setRenderBounds(0.125F, 0.0F, 0.0625F, 0.875F, 0.0625F, 0.9375F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.0625F, 0.0F, 0.125F, 0.125F, 0.0625F, 0.875F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.875F, 0.0F, 0.125F, 0.9375F, 0.0625F, 0.875F);
      renderer.renderStandardBlock(block, x, y, z);

      renderer.setRenderBounds(0.3125F, 0.0625F, 0.255F, 0.6875F, 0.875F, 0.75F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.255F, 0.0625F, 0.3125F, 0.3125F, 0.875F, 0.6875F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.6875F, 0.0625F, 0.3125F, 0.75F, 0.875F, 0.6875F);
      renderer.renderStandardBlock(block, x, y, z);

      renderer.setRenderBounds(0.3125F, 0.9375F, 0.4375F, 0.6875F, 1F, 0.5625F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.3125F, 0.875F, 0.4375F, 0.375F, 0.9375F, 0.5625F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.625F, 0.875F, 0.4375F, 0.6875F, 0.9375F, 0.5625F);
      renderer.renderStandardBlock(block, x, y, z);
    }
    if (world.getBlockMetadata(x, y, z) == 2) {
      renderer.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.0625F, 0.75F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.375F, 0.0625F, 0.375F, 0.625F, 0.125F, 0.625F);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.4375F, 0.125F, 0.4375F, 0.5625F, 1.2F, 0.5625F);
      renderer.renderStandardBlock(block, x, y, z);
    }
    return true;
  }
  public void renderBlockMeteor(
      RenderBlocks renderBlocks, Block par1Block, IBlockAccess var1, int par2, int par3, int par4) {
    var1.getBlockMetadata(par2, par3, par4);

    renderBlocks.setRenderBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.5F, 0.8F);
    renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);

    renderBlocks.setRenderBounds(0.52F, 0.0F, 0.4F, 0.68F, 0.68F, 0.6F);
    renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.65F, 0.75F);
    renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);

    renderBlocks.setRenderBounds(0.15F, 0.0F, 0.25F, 0.2F, 0.4F, 0.75F);
    renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);

    renderBlocks.setRenderBounds(0.8F, 0.0F, 0.25F, 0.85F, 0.4F, 0.75F);
    renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.1F, 0.75F, 0.4F, 0.2F);
    renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.8F, 0.75F, 0.4F, 0.9F);
    renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);

    renderBlocks.clearOverrideBlockTexture();
    par1Block.setBlockBoundsForItemRender();
    renderBlocks.uvRotateTop = 0;
  }
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
    if (modelID == model) {
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0f, 0f, 0f, 1f, 0.5f, 1f);
      int metadata = world.getBlockMetadata(x, y, z);
      BlockSkinRenderHelper.renderLiquidBlock(
          ((SlimePad) block).getFluidIcon(metadata),
          ((SlimePad) block).getFluidIcon(metadata),
          x,
          y,
          z,
          renderer,
          world);

      float[] size = size(metadata % 8);
      renderer.setRenderBounds(size[0], 0.5f, size[1], size[2], 0.6875f, size[3]);
      BlockSkinRenderHelper.renderLiquidBlock(
          ((SlimePad) block).getNubIcon(metadata),
          ((SlimePad) block).getNubIcon(metadata),
          x,
          y,
          z,
          renderer,
          world);
    }
    return true;
  }
Esempio n. 8
0
  @SideOnly(Side.CLIENT)

  /**
   * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color.
   * Note only called when first determining what to render.
   */
  public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
    int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);

    if ((l & 3) == 1) {
      return ColorizerFoliage.getFoliageColorPine();
    } else if ((l & 3) == 2) {
      return ColorizerFoliage.getFoliageColorBirch();
    } else {
      int i1 = 0;
      int j1 = 0;
      int k1 = 0;

      for (int l1 = -1; l1 <= 1; ++l1) {
        for (int i2 = -1; i2 <= 1; ++i2) {
          int j2 =
              par1IBlockAccess.getBiomeGenForCoords(par2 + i2, par4 + l1).getBiomeFoliageColor();
          i1 += (j2 & 16711680) >> 16;
          j1 += (j2 & 65280) >> 8;
          k1 += j2 & 255;
        }
      }

      return (i1 / 9 & 255) << 16 | (j1 / 9 & 255) << 8 | k1 / 9 & 255;
    }
  }
Esempio n. 9
0
  /** Updates the blocks bounds based on its current state. Args: world, x, y, z */
  public void setBlockBoundsBasedOnState(
      IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
    if (!this.isFreestanding) {
      int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
      float var6 = 0.28125F;
      float var7 = 0.78125F;
      float var8 = 0.0F;
      float var9 = 1.0F;
      float var10 = 0.125F;
      this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);

      if (var5 == 2) {
        this.setBlockBounds(var8, var6, 1.0F - var10, var9, var7, 1.0F);
      }

      if (var5 == 3) {
        this.setBlockBounds(var8, var6, 0.0F, var9, var7, var10);
      }

      if (var5 == 4) {
        this.setBlockBounds(1.0F - var10, var6, var8, 1.0F, var7, var9);
      }

      if (var5 == 5) {
        this.setBlockBounds(0.0F, var6, var8, var10, var7, var9);
      }
    }
  }
 public static TileEntity getTileEntity(IBlockAccess blockaccess, int x, int y, int z) {
   HashSet<ChunkCoordinates> visited = Sets.newHashSet();
   Block block = blockaccess.getBlock(x, y, z);
   while (block != NailedBlocks.portalController) {
     if (isValidLinkPortalBlock(block) == 0) {
       return null;
     }
     ChunkCoordinates pos = new ChunkCoordinates(x, y, z);
     if (!visited.add(pos)) {
       return null;
     }
     int meta = blockaccess.getBlockMetadata(x, y, z);
     if (meta == 0) {
       return null;
     }
     if (meta == 1) {
       y--;
     } else if (meta == 2) {
       y++;
     } else if (meta == 3) {
       z--;
     } else if (meta == 4) {
       z++;
     } else if (meta == 5) {
       x--;
     } else if (meta == 6) {
       x++;
     } else {
       return null;
     }
     block = blockaccess.getBlock(x, y, z);
   }
   return blockaccess.getTileEntity(x, y, z);
 }
Esempio n. 11
0
 @Override
 public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
   int meta = world.getBlockMetadata(x, y, z);
   if (side != meta && (side == 0 || side == 1)) return this.topIcon;
   if (side == meta) return this.frontIcon;
   return this.blockIcon;
 }
  @SideOnly(Side.CLIENT)
  public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {

    // check brightness for the side
    if (side == 0 && isBlockLit(world, x, y - 1, z)) {
      return this.blockIconLight;
    }

    if (side == 1 && isBlockLit(world, x, y + 1, z)) {
      return this.blockIconLight;
    }

    if (side == 2 && isBlockLit(world, x, y, z - 1)) {
      return this.blockIconLight;
    }

    if (side == 3 && isBlockLit(world, x, y, z + 1)) {
      return this.blockIconLight;
    }

    if (side == 4 && isBlockLit(world, x - 1, y, z)) {
      return this.blockIconLight;
    }

    if (side == 5 && isBlockLit(world, x + 1, y, z)) {
      return this.blockIconLight;
    }

    return this.getIcon(side, world.getBlockMetadata(x, y, z));
  }
 public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
   Block block = Block.blocksList[world.getBlockId(x, y, z)];
   if (block != null) {
     return block.isFlammable(world, x, y, z, world.getBlockMetadata(x, y, z), face);
   }
   return false;
 }
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    int meta = world.getBlockMetadata(x, y, z);
    boolean hpos = (meta & 1) == 1;
    boolean vpos = (meta & 2) == 2;
    boolean dir = (meta & 4) == 4;
    boolean closed = (meta & 8) == 8;

    if (!vpos) { // bottom
      renderer.setRenderBounds(0, 0, 0, 1, .1f, 1);
    } else { // top
      renderer.setRenderBounds(0, .9f, 0, 1, 1, 1);
    }
    renderer.renderStandardBlock(block, x, y, z);

    if (!dir) {
      if (!hpos) {
        renderer.setRenderBounds(0, 0, 0, .1f, 1, 1);
      } else {
        renderer.setRenderBounds(.9f, 0, 0, 1, 1, 1);
      }
    } else {
      if (!hpos) {
        renderer.setRenderBounds(0, 0, 0, 1, 1, .1f);
      } else {
        renderer.setRenderBounds(0, 0, .9f, 1, 1, 1);
      }
    }
    renderer.renderStandardBlock(block, x, y, z);

    return true;
  }
 @Override
 public boolean renderWorldBlock(
     IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks rb) {
   Tessellator v5 = Tessellator.instance;
   int meta = world.getBlockMetadata(x, y, z);
   if (renderPass == 0) {
     int color = b.colorMultiplier(world, x, y, z);
     float red = ReikaColorAPI.getRed(color) / 255F;
     float grn = ReikaColorAPI.getGreen(color) / 255F;
     float blu = ReikaColorAPI.getBlue(color) / 255F;
     rb.renderStandardBlockWithAmbientOcclusion(b, x, y, z, red, grn, blu);
     return true;
   } else if (renderPass == 1) {
     LightedTreeBlock ltb = (LightedTreeBlock) b;
     IIcon ico = ltb.getOverlay(meta);
     v5.setBrightness(240);
     v5.setColorRGBA_I(0xffffff, b instanceof BlockLeavesBase ? 255 : 220);
     if (ltb.renderOverlayOnSide(0, meta)) rb.renderFaceYNeg(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(1, meta)) rb.renderFaceYPos(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(2, meta)) rb.renderFaceZNeg(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(3, meta)) rb.renderFaceZPos(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(4, meta)) rb.renderFaceXNeg(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(5, meta)) rb.renderFaceXPos(b, x, y, z, ico);
     return true;
   }
   return false;
 }
Esempio n. 16
0
  @SuppressWarnings("incomplete-switch")
  @Override
  public void setBlockBoundsBasedOnState(
      IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
    int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
    int i1 = l & 7;
    boolean flag = (l & 8) > 0;

    ForgeDirection dir = Helper.convertMetaToForgeOrientation(i1);
    switch (dir) {
      case DOWN:
        this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F);
        break;
      case UP:
        this.setBlockBounds(0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F, 1.0F - 0.0625F);
        break;
      case NORTH:
        this.setBlockBounds(0.0625F, 0.0625F, 0.0F, 1.0F - 0.0625F, 1.0F - 0.0625F, 0.0625F);
        break;
      case SOUTH:
        this.setBlockBounds(0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F);
        break;
      case EAST:
        this.setBlockBounds(1.0F - 0.0625F, 0.0625F, 0.0625F, 1.0F, 1.0F - 0.0625F, 1.0F - 0.0625F);
        break;
      case WEST:
        this.setBlockBounds(0.0F, 0.0625F, 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F);
        break;
    }
  }
 @Override
 public int getLightValue(IBlockAccess world, int x, int y, int z) {
   if (world.getBlockMetadata(x, y, z) == 1) {
     return 15;
   }
   return 0;
 }
  @Override
  public void setBlockBoundsBasedOnState(
      IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
    int i = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
    float f = 0.375F;

    setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.375F);
    if (i == 0) {
      setBlockBounds(0.0F, 1.0F - f, 0.0F, 1.0F, 1.0F, 1.0F);
    }

    if (i == 1) {
      setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
    }

    if (i == 2) {
      setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
    }

    if (i == 3) {
      setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
    }

    if (i == 4) {
      setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    }

    if (i == 5) {
      setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
    }
  }
Esempio n. 19
0
  public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
    float pixel = 1F / 16F;

    if (world.getBlockMetadata(x, y, z) < 7)
      this.setBlockBounds(pixel * 4, 0, pixel * 4, 1 - pixel * 4, 1, 1 - pixel * 4);
    else this.setBlockBounds(0, 0, 0, 1, 1, 1);
  }
Esempio n. 20
0
  @Override
  @SideOnly(Side.CLIENT)
  public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
    int l = 0;
    int i1 = 0;
    int j1 = 0;
    int meta = world.getBlockMetadata(x, y, z);

    for (int k1 = -1; k1 <= 1; ++k1) {
      for (int l1 = -1; l1 <= 1; ++l1) {
        BiomeGenBase biome = world.getBiomeGenForCoords(x + l1, z + k1);
        int grassColor = 0;
        if (meta == 1) {
          double temp = (double) MathHelper.clamp_float(biome.getFloatTemperature(), 0.0F, 1.0F);
          double rainfall = (double) MathHelper.clamp_float(biome.getFloatRainfall(), 0.0F, 1.0F);
          grassColor = GrassColorizerAlternate.getBlueGrassColor(temp, rainfall);
        } else if (meta == 2) {
          double temp = (double) MathHelper.clamp_float(biome.getFloatTemperature(), 0.0F, 1.0F);
          double rainfall = (double) MathHelper.clamp_float(biome.getFloatRainfall(), 0.0F, 1.0F);
          grassColor = GrassColorizerAlternate.getOrangeGrassColor(temp, rainfall);
        } else {
          grassColor = biome.getBiomeGrassColor();
        }
        l += (grassColor & 16711680) >> 16;
        i1 += (grassColor & 65280) >> 8;
        j1 += grassColor & 255;
      }
    }
    return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255;
  }
Esempio n. 21
0
  /**
   * Returns true if the block is emitting indirect/weak redstone power on the specified side. If
   * isBlockNormalCube returns true, standard redstone propagation rules will apply instead and this
   * will not be called. Args: World, X, Y, Z, side
   */
  public boolean isProvidingWeakPower(
      IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
    if (!this.wiresProvidePower) {
      return false;
    } else if (par1IBlockAccess.getBlockMetadata(par2, par3, par4) == 0) {
      return false;
    } else if (par5 == 1) {
      return true;
    } else {
      boolean var6 =
          isPoweredOrRepeater(par1IBlockAccess, par2 - 1, par3, par4, 1)
              || !par1IBlockAccess.isBlockNormalCube(par2 - 1, par3, par4)
                  && isPoweredOrRepeater(par1IBlockAccess, par2 - 1, par3 - 1, par4, -1);
      boolean var7 =
          isPoweredOrRepeater(par1IBlockAccess, par2 + 1, par3, par4, 3)
              || !par1IBlockAccess.isBlockNormalCube(par2 + 1, par3, par4)
                  && isPoweredOrRepeater(par1IBlockAccess, par2 + 1, par3 - 1, par4, -1);
      boolean var8 =
          isPoweredOrRepeater(par1IBlockAccess, par2, par3, par4 - 1, 2)
              || !par1IBlockAccess.isBlockNormalCube(par2, par3, par4 - 1)
                  && isPoweredOrRepeater(par1IBlockAccess, par2, par3 - 1, par4 - 1, -1);
      boolean var9 =
          isPoweredOrRepeater(par1IBlockAccess, par2, par3, par4 + 1, 0)
              || !par1IBlockAccess.isBlockNormalCube(par2, par3, par4 + 1)
                  && isPoweredOrRepeater(par1IBlockAccess, par2, par3 - 1, par4 + 1, -1);

      if (!par1IBlockAccess.isBlockNormalCube(par2, par3 + 1, par4)) {
        if (par1IBlockAccess.isBlockNormalCube(par2 - 1, par3, par4)
            && isPoweredOrRepeater(par1IBlockAccess, par2 - 1, par3 + 1, par4, -1)) {
          var6 = true;
        }

        if (par1IBlockAccess.isBlockNormalCube(par2 + 1, par3, par4)
            && isPoweredOrRepeater(par1IBlockAccess, par2 + 1, par3 + 1, par4, -1)) {
          var7 = true;
        }

        if (par1IBlockAccess.isBlockNormalCube(par2, par3, par4 - 1)
            && isPoweredOrRepeater(par1IBlockAccess, par2, par3 + 1, par4 - 1, -1)) {
          var8 = true;
        }

        if (par1IBlockAccess.isBlockNormalCube(par2, par3, par4 + 1)
            && isPoweredOrRepeater(par1IBlockAccess, par2, par3 + 1, par4 + 1, -1)) {
          var9 = true;
        }
      }

      return !var8 && !var7 && !var6 && !var9 && par5 >= 2 && par5 <= 5
          ? true
          : (par5 == 2 && var8 && !var6 && !var7
              ? true
              : (par5 == 3 && var9 && !var6 && !var7
                  ? true
                  : (par5 == 4 && var6 && !var8 && !var9
                      ? true
                      : par5 == 5 && var7 && !var8 && !var9)));
    }
  }
Esempio n. 22
0
 @Override
 public boolean renderWorldBlock(
     IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
   TileEntity tile = world.getTileEntity(x, y, z);
   int side = -1;
   int meta = world.getBlockMetadata(x, y, z);
   if (tile != null && tile instanceof TileInjector) side = ((TileInjector) tile).side;
   switch (side) {
     case 2:
       RenderBlocksHelper.renderFace(
           world,
           renderer,
           block,
           x,
           y,
           z,
           "x",
           PillarMaterials.values()[meta].block.getIcon(0, 0));
       break;
     case 3:
       RenderBlocksHelper.renderFace(
           world,
           renderer,
           block,
           x,
           y,
           z,
           "x",
           PillarMaterials.values()[meta].block.getIcon(0, 0));
       break;
     case 4:
       RenderBlocksHelper.renderFace(
           world,
           renderer,
           block,
           x,
           y,
           z,
           "z",
           PillarMaterials.values()[meta].block.getIcon(0, 0));
       break;
     case 5:
       RenderBlocksHelper.renderFace(
           world,
           renderer,
           block,
           x,
           y,
           z,
           "z",
           PillarMaterials.values()[meta].block.getIcon(0, 0));
       break;
     case -1:
       break;
     default:
       break;
   }
   return true;
 }
Esempio n. 23
0
 /** Updates the blocks bounds based on its current state. Args: world, x, y, z */
 public void setBlockBoundsBasedOnState(
     IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
   int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
   float f = 0.0625F;
   float f1 = (float) (1 + l * 2) / 16.0F;
   float f2 = 0.5F;
   this.setBlockBounds(f1, 0.0F, f, 1.0F - f, f2, 1.0F - f);
 }
 public float getSize(IBlockAccess iba, int x, int y, int z) {
   switch (iba.getBlockMetadata(x, y, z)) {
     case 2:
       return 0.75F;
     default:
       return 1;
   }
 }
Esempio n. 25
0
 /** Updates the blocks bounds based on its current state. Args: world, x, y, z */
 public void setBlockBoundsBasedOnState(
     IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
   this.maxY =
       (double) ((float) (par1IBlockAccess.getBlockMetadata(par2, par3, par4) * 2 + 2) / 16.0F);
   float var5 = 0.125F;
   this.setBlockBounds(
       0.5F - var5, 0.0F, 0.5F - var5, 0.5F + var5, (float) this.maxY, 0.5F + var5);
 }
Esempio n. 26
0
  @SideOnly(Side.CLIENT)

  /**
   * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color.
   * Note only called when first determining what to render.
   */
  public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
    return this.getRenderColor(par1IBlockAccess.getBlockMetadata(par2, par3, par4));
  }
Esempio n. 27
0
 /** Updates the blocks bounds based on its current state. Args: world, x, y, z */
 @Override
 public void setBlockBoundsBasedOnState(
     IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
   final int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
   final float var6 = 0.0625F;
   final float var7 = (1 + var5 * 2) / 16.0F;
   final float var8 = 0.5F;
   this.setBlockBounds(var7, 0.0F, var6, 1.0F - var6, var8, 1.0F - var6);
 }
Esempio n. 28
0
 @Override
 public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
   int facing = world.getBlockMetadata(x, y, z);
   if ((facing == 2) || (facing == 3)) {
     setBlockBounds(0.4f, 0.52f, 0.0f, 0.6f, 0.72f, 1.00f);
   } else {
     setBlockBounds(0.0f, 0.52f, 0.4f, 1.0f, 0.72f, 0.6f);
   }
 }
  @Override
  public int getLightValue(IBlockAccess world, int x, int y, int z) {

    if (maxScaledLight == 0) {
      return super.getLightValue(world, x, y, z);
    }
    int data = quantaPerBlock - world.getBlockMetadata(x, y, z) - 1;
    return (int) ((data / quantaPerBlockFloat) * maxScaledLight);
  }
Esempio n. 30
0
  public int func_150012_g(
      IBlockAccess p_150012_1_, int p_150012_2_, int p_150012_3_, int p_150012_4_) {
    int l = p_150012_1_.getBlockMetadata(p_150012_2_, p_150012_3_, p_150012_4_);
    boolean flag = (l & 8) != 0;
    int i1;
    int j1;

    if (flag) {
      i1 = p_150012_1_.getBlockMetadata(p_150012_2_, p_150012_3_ - 1, p_150012_4_);
      j1 = l;
    } else {
      i1 = l;
      j1 = p_150012_1_.getBlockMetadata(p_150012_2_, p_150012_3_ + 1, p_150012_4_);
    }

    boolean flag1 = (j1 & 1) != 0;
    return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
  }