@Override
  public int getLightValue(IBlockAccess world, int x, int y, int z) {
    if (world.getBlockId(x, y, z) == this.blockID
        && world.getBlockTileEntity(x, y, z) instanceof TileEntityLandmine) {
      TileEntityLandmine te = (TileEntityLandmine) world.getBlockTileEntity(x, y, z);

      if (te != null) {
        if (te.getStackInSlot(3) != null) {
          return lightValue[te.getStackInSlot(3).itemID];
        }
      }
    }
    return super.getLightValue(world, x, y, z);
  }
  @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));
  }
Example #3
0
  @Override
  public Icon getBlockTexture(IBlockAccess blockAccess, int x, int y, int z, int side) {
    TileEP frame = (TileEP) blockAccess.getBlockTileEntity(x, y, z);
    Icon frameIcon = frame != null ? frame.getTexture(side, renderPass) : null;

    return frameIcon == null ? super.getBlockTexture(blockAccess, x, y, z, side) : frameIcon;
  }
  private TileEntityBFurnace getBFurnAt(IBlockAccess world, int x, int y, int z) {
    TileEntity tile = world.getBlockTileEntity(x, y, z);
    if (tile == null) return null;

    if (tile instanceof TileEntityBFurnace) return (TileEntityBFurnace) tile;

    return null;
  }
  private TileEntityBFurnace getFurnaceInstance(IBlockAccess world, int x, int y, int z) {
    if (world.getBlockTileEntity(x, y, z) == null) return null;

    TileEntityBFurnace bfurn = getBFurnAt(world, x, y, z);
    if (bfurn == null) return null;

    return bfurn;
  }
Example #6
0
  public static Pipe getPipe(IBlockAccess blockAccess, int i, int j, int k) {

    TileEntity tile = blockAccess.getBlockTileEntity(i, j, k);

    if (!(tile instanceof TileGenericPipe) || tile.isInvalid()) return null;

    return ((TileGenericPipe) tile).pipe;
  }
 private TileEntityOutput getTileEntity(IBlockAccess world, int x, int y, int z) {
   TileEntity te = world.getBlockTileEntity(x, y, z);
   if (te instanceof TileEntityOutput) {
     return (TileEntityOutput) te;
   } else {
     return null;
   }
 }
 @Override
 public int isProvidingWeakPower(IBlockAccess iblockaccess, int x, int y, int z, int m) {
   TileEntity tile = iblockaccess.getBlockTileEntity(x, y, z);
   if ((tile != null) && ((tile instanceof IBasicSensor))) {
     return ((IBasicSensor) tile).getPowerOutput();
   }
   return 0;
 }
  @Override
  public int getLightValue(IBlockAccess iBlockAccess, int x, int y, int z) {
    TFangYingJi tileEntity = (TFangYingJi) iBlockAccess.getBlockTileEntity(x, y, z);

    if (tileEntity.getMode() != null) {
      return 10;
    }

    return super.getLightValue(iBlockAccess, x, y, z);
  }
Example #10
0
  /** Is this block indirectly powering the block on the specified side */
  public boolean isIndirectlyPoweringTo(IBlockAccess iblock, int x, int y, int z, int dir) {
    boolean res;
    TileEntity tile = iblock.getBlockTileEntity(x, y, z);
    if (tile instanceof TileExtender) {
      TileExtender tilee = (TileExtender) tile;
      res = tilee.isSidePowered(ForgeDirection.getOrientation(dir).getOpposite());
    } else res = false;

    return res;
  }
Example #11
0
  public static void setSudisBlockBoundsBasedOnState(
      Block block, IBlockAccess blockAccess, int x, int y, int z, int yOffset) {
    TileEntitySudis tileEntitySudis = (TileEntitySudis) blockAccess.getBlockTileEntity(x, y, z);

    int connectCount = 0;
    float f = 0.375F;
    float f1 = 0.625F;
    float f2 = 0.375F;
    float f3 = 0.625F;

    if (tileEntitySudis != null && tileEntitySudis.getHasMultipleSudes()) {
      boolean flag = canConnectSudisTo(blockAccess, x, y, z - 1);
      boolean flag1 = canConnectSudisTo(blockAccess, x, y, z + 1);
      boolean flag2 = canConnectSudisTo(blockAccess, x - 1, y, z);
      boolean flag3 = canConnectSudisTo(blockAccess, x + 1, y, z);
      if (flag) {
        connectCount++;
      }
      if (flag1) {
        connectCount++;
      }
      if (flag2) {
        connectCount++;
      }
      if (flag3) {
        connectCount++;
      }
      if (connectCount == 0) {
        int metadata = blockAccess.getBlockMetadata(x, y, z);
        int facing = metadata & BlockHelper.MASK_DIR;
        if (facing == BlockHelper.META_DIR_NORTH || facing == BlockHelper.META_DIR_SOUTH) {
          f = .0f;
          f1 = 1.0f;
        } else {
          f2 = .0f;
          f3 = 1.0f;
        }
      } else {
        if (flag || (flag1 && connectCount <= 1)) {
          f2 = 0.0F;
        }
        if (flag1 || (flag && connectCount <= 1)) {
          f3 = 1.0F;
        }
        if (flag2 || (flag3 && connectCount <= 1)) {
          f = 0.0F;
        }
        if (flag3 || (flag2 && connectCount <= 1)) {
          f1 = 1.0F;
        }
      }
    }

    block.setBlockBounds(f, yOffset, f2, f1, MODEL_SUDIS_HEIGHT + yOffset, f3);
  }
Example #12
0
 @Override
 public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int blockSide) {
   TileEntity te = world.getBlockTileEntity(x, y, z);
   if (te instanceof TileEntityCustomBlock) {
     TileEntityCustomBlock tef = (TileEntityCustomBlock) te;
     if (tef.getSourceBlockId() > 0 && tef.getSourceBlockId() < Block.blocksList.length) {
       return blocksList[tef.getSourceBlockId()].getIcon(blockSide, tef.getSourceBlockMetadata());
     }
   }
   return blocksList[Block.anvil.blockID].getBlockTexture(world, x, y, z, blockSide);
 }
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    TileEntity tile = world.getBlockTileEntity(x, y, z);

    if (tile instanceof IPipeRenderState) {
      IPipeRenderState pipeTile = (IPipeRenderState) tile;
      renderPipe(renderer, world, block, pipeTile, x, y, z);
    }
    return true;
  }
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    renderer.renderStandardBlock(block, x, y, z);

    Tessellator ts = Tessellator.instance;
    ForgeDirection face = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
    BlockTerminalFluid terminalBlock = (BlockTerminalFluid) block;
    int[] color = {0, 0, 0};
    TileEntity blockTE = world.getBlockTileEntity(x, y, z);
    if (blockTE instanceof TileEntityTerminalFluid) {
      TileEntityTerminalFluid terminalTE = (TileEntityTerminalFluid) blockTE;
      switch (terminalTE.getColor()) {
        case -1:
          color = fluix.clone();
          break;
        case 0:
          color = blue.clone();
          break;
        case 1:
          color = black.clone();
          break;
        case 2:
          color = white.clone();
          break;
        case 3:
          color = brown.clone();
          break;
        case 4:
          color = red.clone();
          break;
        case 5:
          color = yellow.clone();
          break;
        case 6:
          color = green.clone();
          break;
      }

      boolean active = terminalTE.isMachineActive();

      ts.setBrightness(15 << 2 | 15 << 0);

      if (active) ts.setBrightness(15 << 20 | 15 << 4);

      ts.setColorOpaque_I(0xFFFFFF);
      drawFace(face, block, x, y, z, terminalBlock.baseLayer, renderer);
      for (int i = 0; i < 3; i++) {
        ts.setColorOpaque_I(color[i]);
        drawFace(face, block, x, y, z, terminalBlock.colorLayers[i], renderer);
      }
    }
    return true;
  }
  @Override
  public IIcon getBlockTexture(
      IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
    TileEntityLandmine te =
        (TileEntityLandmine) par1IBlockAccess.getBlockTileEntity(par2, par3, par4);

    ItemStack camo = te.getStackInSlot(3);
    if (camo != null && camo.itemID < blocksList.length) {
      return Block.blocksList[camo.itemID].getIcon(par5, camo.getItemDamage());
    } else {
      return this.getIcon(par5, par1IBlockAccess.getBlockMetadata(par2, par3, par4));
    }
  }
Example #16
0
  @Override
  public int colorMultiplier(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) {
    TilePortalFrame frame = (TilePortalFrame) par1iBlockAccess.getBlockTileEntity(par2, par3, par4);
    TilePortalFrameController controller = frame.getControllerValidated();

    if (controller != null) {
      return controller.frameTexture.TextureColour;
    } else if (frame instanceof TilePortalFrameController) {
      return ((TilePortalFrameController) frame).frameTexture.TextureColour;
    }

    return super.colorMultiplier(par1iBlockAccess, par2, par3, par4);
  }
Example #17
0
 @Override
 public boolean renderWorldBlock(
     IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
   TileEntity te = world.getBlockTileEntity(x, y, z);
   if (te instanceof TileCapacitorBank) {
     TileCapacitorBank cb = ((TileCapacitorBank) te);
     cb.energyAtLastRender = cb.getEnergyStored();
   }
   connectedTexRenderer.setEdgeTexture(
       EnderIO.blockAlloySmelter.getBlockTextureFromSide(
           3)); // can't do in constructor as texture not loaded yet
   CustomCubeRenderer.instance.renderBlock(world, block, x, y, z, renderers);
   return true;
 }
  @Override
  public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) {
    int meta = world.getBlockMetadata(x, y, z);
    ForgeDirection sideForge = ForgeDirection.getOrientation(side);
    IRotatable rotate = (IRotatable) world.getBlockTileEntity(x, y, z);

    switch (sideForge) {
      case UP:
        return textures[meta][1];
      case DOWN:
        return textures[meta][0];
      default:
        if (sideForge != rotate.getRotation()) return textures[meta][2];
    }

    switch (meta) {
      case 0:
        {
          TileEntityAmalgamFurnace furnace =
              (TileEntityAmalgamFurnace) world.getBlockTileEntity(x, y, z);

          if (!furnace.isActive() && furnace.fakePowerAmount == 0) {
            return textures[0][3];
          } else if (furnace.isActive() && furnace.fakePowerAmount == 0) {
            return textures[0][4];
          } else if (!furnace.isActive() && furnace.fakePowerAmount != 0) {
            return textures[0][5];
          } else if (furnace.isActive() && furnace.fakePowerAmount != 0) {
            return textures[0][6];
          }
        }
    }

    // Default if all else fails
    return textures[meta][2];
  }
  @Override
  public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
    if (side == 0 || side == 1) {
      return REDSTONE_VALUE_OFF;
    }

    TileEntity te = world.getBlockTileEntity(x, y, z);
    if (te instanceof TileEntityReactorRedstonePort) {
      TileEntityReactorRedstonePort port = (TileEntityReactorRedstonePort) te;
      if (port.isOutput()) return port.isRedstoneActive() ? REDSTONE_VALUE_ON : REDSTONE_VALUE_OFF;
      else return REDSTONE_VALUE_OFF;
    }

    return REDSTONE_VALUE_OFF;
  }
  @Override
  @SideOnly(Side.CLIENT)
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
    TileEntity tile = world.getBlockTileEntity(x, y, z);

    if (tile != null && tile instanceof TileEntitySubtype) {
      TileEntitySubtype te = (TileEntitySubtype) tile;
      if (sub.containsKey(te.getSubtype())) {
        return sub.get(te.getSubtype()).renderWorldBlock(world, x, y, z, block, modelID, renderer);
      }
    }

    return false;
  }
Example #21
0
  @SideOnly(value = Side.CLIENT)
  @Override
  public Icon getBlockTexture(IBlockAccess iba, int x, int y, int z, int side) {
    TileEntityGunBox TE = (TileEntityGunBox) iba.getBlockTileEntity(x, y, z);
    GunBoxType type = TE.getType();

    if (type == null) return null;

    if (side == 1) {
      return type.top;
    }
    if (side == 0) {
      return type.bottom;
    }
    return type.side;
  }
Example #22
0
  public IIcon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) {
    TileEntity logic = world.getBlockTileEntity(x, y, z);
    short direction =
        (logic instanceof IFacingLogic) ? ((IFacingLogic) logic).getRenderDirection() : 0;
    int meta = world.getBlockMetadata(x, y, z) % 8;

    if (meta == 0) {
      if (side == direction) {
        if (((IActiveLogic) logic).getActive()) return icons[1];
        else return icons[0];
      } else if (side > 1) {
        return icons[2];
      }
      return icons[3];
    }
    return icons[0];
  }
 public int getBlockTextureInt(IBlockAccess world, int x, int y, int z, int side) {
   TileEntityBFurnace tile = (TileEntityBFurnace) world.getBlockTileEntity(x, y, z);
   if (tile != null) {
     byte facing = tile.direction;
     int meta = tile.getBlockMetadata();
     if (meta == 2) // output
     {
       if (side == 0) return 0;
     }
     if (meta == 1 || meta == 2) // Input/fuel
     {
       if (side != facing) return 0;
       else return 2;
     }
   }
   if (side == 0 || side == 1) return 1;
   return 0;
 }
Example #24
0
  @SuppressWarnings({"all"})
  @SideOnly(Side.CLIENT)
  public Icon getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {

    TileEntity tile = iblockaccess.getBlockTileEntity(i, j, k);
    if (!(tile instanceof IPipeRenderState)) return null;
    return ((IPipeRenderState) tile).getRenderState().currentTexture;

    // Pipe pipe = getPipe(iblockaccess, i, j, k);
    // if (!isValid(pipe)) {
    // CoreProxy.BindTexture(DefaultProps.TEXTURE_BLOCKS);
    // return 0;
    // }
    // int pipeTexture = pipe.getPipeTexture();
    // if (pipeTexture > 255) {
    // CoreProxy.BindTexture(DefaultProps.TEXTURE_EXTERNAL);
    // return pipeTexture - 256;
    // }
    // CoreProxy.BindTexture(DefaultProps.TEXTURE_BLOCKS);
    // return pipeTexture;
  }
 @Override
 public Icon getBlockTexture(IBlockAccess blockAccess, int x, int y, int z, int side) {
   switch (side) {
     case 0:
       return Icons.bottom;
     case 1:
       return Icons.top;
     default:
       TileEntity tile = blockAccess.getBlockTileEntity(x, y, z);
       if ((tile != null) && ((tile instanceof TileEntityBasicProximitySensor))) {
         switch (((TileEntityBasicProximitySensor) tile).getEntityMode()) {
           case ProximitySensor.MODE_ALL:
             return Icons.sideAll;
           case ProximitySensor.MODE_OWNER:
             return Icons.sideOwner;
           case ProximitySensor.MODE_PLAYERS:
             return Icons.sidePlayers;
         }
       }
       return Icons.sideAll;
   }
 }
  /**
   * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
   */
  public int getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int var5) {
    TileEntity var6 = var1.getBlockTileEntity(var2, var3, var4);
    int var7 = var1.getBlockMetadata(var2, var3, var4);
    int var8 =
        var6 instanceof FF_TileEntityMetalFurnace
            ? ((FF_TileEntityMetalFurnace) var6).getDirection()
            : 0;

    if (var6 instanceof FF_TileEntityMetalFurnace) {
      int var10000 = ((FF_TileEntityMetalFurnace) var6).furnaceCookTime * 10 % 2;
    } else {
      boolean var11 = false;
    }

    boolean var10 =
        var6 instanceof FF_TileEntityMetalFurnace
            ? ((FF_TileEntityMetalFurnace) var6).isBurning()
            : false;
    return var5 != 1 && var5 != 0
        ? (var5 != var8 ? 1 + var7 * 16 : (var10 ? 4 + var7 * 16 : 0 + var7 * 16))
        : 2 + var7 * 16;
  }
	@Override
	public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
			Block block, int modelId, RenderBlocks renderer) {
		CCRenderState.reset();
		CCRenderState.useNormals(true);
		CCRenderState.useModelColours(true);
		TileEntityRedNetCable _cable = (TileEntityRedNetCable)world.getBlockTileEntity(x, y, z);
		TileEntityRedNetEnergy _cond = null;
		int brightness = block.getMixedBrightnessForBlock(world, x, y, z);
		int bandBrightness = brightBand ? 0xd00070 : brightness;

		Tessellator tess = Tessellator.instance;
		tess.setColorOpaque_F(1,1,1);
		tess.setBrightness(brightness);

		Translation tlate = new Translation(new Vector3(x, y, z));

		base.render(tlate, uvt);
		if (_cable instanceof TileEntityRedNetEnergy) {
			cage.render(tlate, uvt);
			_cond = (TileEntityRedNetEnergy)_cable;
		}

		for (ForgeDirection f : ForgeDirection.VALID_DIRECTIONS) {
			int side = f.ordinal();
			RedNetConnectionType state = _cable.getConnectionState(f);
			switch (state.flags & 31) {
			case 11: // isCable, isSingleSubnet
				tess.setBrightness(bandBrightness);
				band[side].setColour(_cable.getSideColorValue(f));
				band[side].render(tlate, uvt);
				tess.setColorOpaque_F(1,1,1);
				tess.setBrightness(brightness);
			case 19: // isCable, isAllSubnets
				if (state.isSingleSubnet) {
					iface[side].render(tlate, uvt);
					grip[side].render(tlate, uvt);
				} else
					cable[side].render(tlate, uvt);
				break;
			case 13: // isPlate, isSingleSubnet
				tess.setBrightness(bandBrightness);
				band[side].setColour(_cable.getSideColorValue(f));
				band[side].render(tlate, uvt);
				platef[side].setColour(_cable.getSideColorValue(f));
				platef[side].render(tlate, uvt);
				tess.setColorOpaque_F(1,1,1);
				tess.setBrightness(brightness);
			case 21: // isPlate, isAllSubnets
				iface[side].render(tlate, uvt);
				plate[side].render(tlate, uvt);
				if (state.isAllSubnets) {
					platef[side].setColour(-1);
					platef[side].render(tlate, uvt);
				}
			default:
				break;
			}
			if (_cond != null && _cond.isInterfacing(f)) {
				wire[side].render(tlate, uvt);
				if (_cond.interfaceMode(f) != 4)
					caps[side].render(tlate, uvt);
			}
		}

		return true;
	}
 @Override
 public int getLightValue(IBlockAccess world, int x, int y, int z) {
   return ((BucketTE) world.getBlockTileEntity(x, y, z)).getLightLevel();
 }
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
    if (modelID == renderID) {
      CastingChannelLogic tile = (CastingChannelLogic) world.getBlockTileEntity(x, y, z);

      if (!tile.hasTankConnected(
          ForgeDirection.DOWN)) // CentrePiece, floor is removed if tank below is found
      {
        renderer.setRenderBounds(0.3125D, 0.375D, 0.3125D, 0.6875D, 0.5D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
      } else
      // "Guiding Borders" when tank below is found
      {
        renderer.setRenderBounds(0.375D, 0.125D, 0.3125D, 0.625D, 0.5D, 0.375D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0.375D, 0.125D, 0.625D, 0.625D, 0.5D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0.3125D, 0.125D, 0.3125D, 0.375D, 0.5D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0.625D, 0.125D, 0.3125D, 0.6875D, 0.5D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
      }
      /*renderer.setRenderBounds(0.3125D, 0.375D, 0.3125D, 0.375D, 0.625D, 0.375D);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.3125D, 0.375D, 0.625D, 0.375D, 0.625D, 0.6875D);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.625D, 0.375D, 0.3125D, 0.6875D, 0.625D, 0.375D);
      renderer.renderStandardBlock(block, x, y, z);
      renderer.setRenderBounds(0.625D, 0.375D, 0.625D, 0.6875D, 0.625D, 0.6875D);
      renderer.renderStandardBlock(block, x, y, z);*/
      if (tile.hasTankConnected(ForgeDirection.NORTH)) // Channel to Z-
      {
        renderer.setRenderBounds(0.3125D, 0.375D, 0D, 0.6875D, 0.5D, 0.3125D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0.3125D, 0.5D, 0D, 0.375D, 0.625D, 0.3125D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0.625D, 0.5D, 0D, 0.6875D, 0.625D, 0.3125D);
        renderer.renderStandardBlock(block, x, y, z);
      } else
      // Wall to Z-
      {
        renderer.setRenderBounds(0.375D, 0.5D, 0.3125D, 0.625D, 0.625D, 0.375D);
        renderer.renderStandardBlock(block, x, y, z);
      }

      if (tile.hasTankConnected(ForgeDirection.SOUTH)) // Channel to Z+
      {
        renderer.setRenderBounds(0.3125D, 0.375D, 0.6875D, 0.6875D, 0.5D, 1D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0.3125D, 0.5D, 0.6875D, 0.375D, 0.625D, 1D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0.625D, 0.5D, 0.6875D, 0.6875D, 0.625D, 1D);
        renderer.renderStandardBlock(block, x, y, z);
      } else
      // Wall to Z+
      {
        renderer.setRenderBounds(0.375D, 0.5D, 0.625D, 0.625D, 0.625D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
      }

      if (tile.hasTankConnected(ForgeDirection.WEST)) // Channel to X-
      {
        renderer.setRenderBounds(0D, 0.375D, 0.3125D, 0.3125D, 0.5D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0D, 0.5D, 0.3125D, 0.375D, 0.625D, 0.375D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0D, 0.5D, 0.625D, 0.375D, 0.625D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
      } else
      // Wall to X-
      {
        renderer.setRenderBounds(0.3125D, 0.5D, 0.3125D, 0.375D, 0.625D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
      }

      if (tile.hasTankConnected(ForgeDirection.EAST)) // Channel to X+
      {
        renderer.setRenderBounds(0.6875D, 0.375D, 0.3125D, 1D, 0.5D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0.625D, 0.5D, 0.3125D, 1D, 0.625D, 0.375D);
        renderer.renderStandardBlock(block, x, y, z);
        renderer.setRenderBounds(0.625D, 0.5D, 0.625D, 1D, 0.625D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
      } else
      // Wall to X+
      {
        renderer.setRenderBounds(0.625D, 0.5D, 0.3125D, 0.6875D, 0.625D, 0.6875D);
        renderer.renderStandardBlock(block, x, y, z);
      }

      if (tile.liquid != null) {
        float height = tile.getLiquidAmount() / (tile.getCapacity() * 1.05F);
        float j = tile.liquid.amount / tile.fillMax;
        double startY = tile.tankBelow();
        // if(tile.nearbyChannel(ForgeDirection.DOWN))startY = -0.5D;
        // else if(tile.hasTankConnected(ForgeDirection.DOWN))startY = 0D;
        float liquidAmount = tile.liquid.amount / 288f * 0.125f;
        renderer.setRenderBounds(
            0.375D, startY, 0.375D, 0.625D, 0.5 + liquidAmount, 0.625D); // Center
        renderLiquidPart(world, x, y, z, block, renderer, tile);
        // System.out.println(tile.recentlyFilledDelay);

        if (tile.hasTankConnected(ForgeDirection.NORTH)) {
          if (tile.lastProvider == ForgeDirection.NORTH) {
            renderer.setRenderBounds(0.375D, 0.5D, 0D, 0.625D, 0.5 + liquidAmount, 0.375D);
            renderLiquidPart(world, x, y, z, block, renderer, tile);
          } else {
            if (tile.recentlyFilledDelay == 0) {
              renderer.setRenderBounds(0.375D, 0.5D, 0D, 0.625D, 0.5 + liquidAmount, 0.375D);
              renderLiquidPart(world, x, y, z, block, renderer, tile);
            }
          }
        }
        if (tile.hasTankConnected(ForgeDirection.SOUTH)) {
          if (tile.lastProvider == ForgeDirection.SOUTH) {
            renderer.setRenderBounds(0.375D, 0.5D, 0.625D, 0.625D, 0.5 + liquidAmount, 1D);
            renderLiquidPart(world, x, y, z, block, renderer, tile);
          } else {
            if (tile.recentlyFilledDelay == 0) {
              renderer.setRenderBounds(0.375D, 0.5D, 0.625D, 0.625D, 0.5 + liquidAmount, 1D);
              renderLiquidPart(world, x, y, z, block, renderer, tile);
            }
          }
        }
        if (tile.hasTankConnected(ForgeDirection.WEST)) {
          if (tile.lastProvider == ForgeDirection.WEST) {
            renderer.setRenderBounds(0D, 0.5D, 0.375D, 0.375D, 0.5 + liquidAmount, 0.625D);
            renderLiquidPart(world, x, y, z, block, renderer, tile);
          } else {
            if (tile.recentlyFilledDelay == 0) {
              renderer.setRenderBounds(0D, 0.5D, 0.375D, 0.375D, 0.5 + liquidAmount, 0.625D);
              renderLiquidPart(world, x, y, z, block, renderer, tile);
            }
          }
        }
        if (tile.hasTankConnected(ForgeDirection.EAST)) {
          if (tile.lastProvider == ForgeDirection.EAST) {
            renderer.setRenderBounds(0.625D, 0.5D, 0.375D, 1D, 0.5 + liquidAmount, 0.625D);
            renderLiquidPart(world, x, y, z, block, renderer, tile);
          } else {
            if (tile.recentlyFilledDelay == 0) {
              renderer.setRenderBounds(0.625D, 0.5D, 0.375D, 1D, 0.5 + liquidAmount, 0.625D);
              renderLiquidPart(world, x, y, z, block, renderer, tile);
            }
          }
        }
        /*if(tile.lastProvider==ForgeDirection.UP && tile.recentlyFilledDelay != 0)
        {
        	renderer.setRenderBounds(0.375D, 0.5D, 0.375D, 0.625D, 1D, 0.625D);
        	renderLiquidPart(world, x, y, z, block, renderer, tile);
        }*/

        /*if(tile.hasTankConnected(ForgeDirection.NORTH)&&tile.lastProvider!=ForgeDirection.NORTH)//Channel to Z-
        {
        	if(tile.recentlyFilledDelay == 0 || tile.lastProvider == ForgeDirection.UP)
        	{
        		renderer.setRenderBounds(0.375D, 0.5D, 0D, 0.625D, 0.625D, 0.375D);
        		renderLiquidPart(world, x, y, z, block, renderer, tile);
        	}
        	if(tile.recentlyFilledDelay != 0 && tile.lastProvider == ForgeDirection.UP)
        	{
        			renderer.setRenderBounds(0.375D, 0.375D, 0.375D, 0.625D, 1D, 0.625D);
        			renderLiquidPart(world, x, y, z, block, renderer, tile);
        	}
        }
        if(tile.hasTankConnected(ForgeDirection.SOUTH)&&tile.lastProvider!=ForgeDirection.SOUTH)//Channel to Z+
        {
        	if(tile.recentlyFilledDelay == 0 || tile.lastProvider == ForgeDirection.UP)
        	{
        		renderer.setRenderBounds(0.375D, 0.5D, 0.625D, 0.625D, 0.625D, 1D);
        		renderLiquidPart(world, x, y, z, block, renderer, tile);
        	}
        	if(tile.recentlyFilledDelay != 0 && tile.lastProvider == ForgeDirection.UP)
        	{
        		renderer.setRenderBounds(0.375D, 0.375D, 0.375D, 0.625D, 1D, 0.625D);
        		renderLiquidPart(world, x, y, z, block, renderer, tile);
        	}
        }
        if(tile.hasTankConnected(ForgeDirection.WEST)&&tile.lastProvider!=ForgeDirection.WEST)//Channel to X-
        {
        	if(tile.recentlyFilledDelay == 0 || tile.lastProvider == ForgeDirection.UP)
        	{
        		renderer.setRenderBounds(0D, 0.5D, 0.375D, 0.375D, 0.625D, 0.625D);
        		renderLiquidPart(world, x, y, z, block, renderer, tile);
        	}
        	if(tile.recentlyFilledDelay != 0 && tile.lastProvider == ForgeDirection.UP)
        	{
        		renderer.setRenderBounds(0.375D, 0.375D, 0.375D, 0.625D, 1D, 0.625D);
        		renderLiquidPart(world, x, y, z, block, renderer, tile);
        	}
        }
        if(tile.hasTankConnected(ForgeDirection.EAST)&&tile.lastProvider!=ForgeDirection.EAST)//Channel to X+
        {
        	if(tile.recentlyFilledDelay == 0 || tile.lastProvider == ForgeDirection.UP)
        	{
        		renderer.setRenderBounds(0.625D, 0.5D, 0.375D, 1D, 0.625D, 0.625D);
        		renderLiquidPart(world, x, y, z, block, renderer, tile);
        	}
        	if(tile.recentlyFilledDelay != 0 && tile.lastProvider == ForgeDirection.UP)
        	{
        		renderer.setRenderBounds(0.375D, 0.375D, 0.375D, 0.625D, 1D, 0.625D);
        		renderLiquidPart(world, x, y, z, block, renderer, tile);
        	}
        }
        if(tile.lastProvider==ForgeDirection.NORTH && tile.recentlyFilledDelay != 0)
        {
        	renderer.setRenderBounds(0.375D, 0.5D, 0.625D, 0.625D, 0.625D, 1D);
        	renderLiquidPart(world, x, y, z, block, renderer, tile);
        }
        if(tile.lastProvider==ForgeDirection.SOUTH && tile.recentlyFilledDelay != 0)
        {
        	renderer.setRenderBounds(0.375D, 0.5D, 0D, 0.625D, 0.625D, 0.375D);
        	renderLiquidPart(world, x, y, z, block, renderer, tile);
        }
        if(tile.lastProvider==ForgeDirection.WEST && tile.recentlyFilledDelay != 0)
        {
        	renderer.setRenderBounds(0.625D, 0.5D, 0.375D, 1D, 0.625D, 0.625D);
        	renderLiquidPart(world, x, y, z, block, renderer, tile);
        }
        if(tile.lastProvider==ForgeDirection.EAST && tile.recentlyFilledDelay != 0)
        {
        	renderer.setRenderBounds(0D, 0.5D, 0.375D, 0.375D, 0.625D, 0.625D);
        	renderLiquidPart(world, x, y, z, block, renderer, tile);
        }*/
      }
    }
    return true;
  }
 @Override
 public int isProvidingWeakPower(IBlockAccess w, int x, int y, int z, int side) {
   TileEntityProjectRedPeripheral tile =
       (TileEntityProjectRedPeripheral) w.getBlockTileEntity(x, y, z);
   return tile.getRedstonePower(convertRedstoneToForgeDirection(side));
 }