Package powercrystals.minefactoryreloaded.block

Examples of powercrystals.minefactoryreloaded.block.BlockFactoryGlassPane


public class FactoryGlassPaneRenderer implements ISimpleBlockRenderingHandler
{
  @Override
  public void renderInventoryBlock(Block tile, int metadata, int modelID, RenderBlocks renderer)
  {
    BlockFactoryGlassPane block = (BlockFactoryGlassPane)tile;

    Tessellator tessellator = Tessellator.instance;
    int color = block.getRenderColor(metadata);
    float red = (color >> 16 & 255) / 255.0F;
    float green = (color >> 8 & 255) / 255.0F;
    float blue = (color & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
      float anaglyphRed = (red * 30.0F + green * 59.0F + blue * 11.0F) / 100.0F;
      float anaglyphGreen = (red * 30.0F + green * 70.0F) / 100.0F;
      float anaglyphBlue = (red * 30.0F + blue * 70.0F) / 100.0F;
      red = anaglyphRed;
      green = anaglyphGreen;
      blue = anaglyphBlue;
    }
    Icon iconGlass, iconStreaks, iconSide, iconOverlay;

    iconGlass = block.getIcon(0, metadata);
    iconStreaks = block.getIcon(0, 16 | metadata);
    iconSide = block.getSideTextureIndex();
    iconOverlay = block.getBlockOverlayTexture();

    double minXGlass = iconGlass.getMinU();
    double maxXGlass = iconGlass.getMaxU();
    double minYGlass = iconGlass.getMinV();
    double maxYGlass = iconGlass.getMaxV();
View Full Code Here


  @Override
  public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z,
      Block tile, int modelId, RenderBlocks renderer)
  {
    BlockFactoryGlassPane block = (BlockFactoryGlassPane)tile;

    int worldHeight = blockAccess.getHeight();
    int metadata = blockAccess.getBlockMetadata(x, y, z);
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(tile.getMixedBrightnessForBlock(blockAccess, x, y, z));
    int color = block.getRenderColor(metadata);
    float red = (color >> 16 & 255) / 255.0F;
    float green = (color >> 8 & 255) / 255.0F;
    float blue = (color & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
      float anaglyphRed = (red * 30.0F + green * 59.0F + blue * 11.0F) / 100.0F;
      float anaglyphGreen = (red * 30.0F + green * 70.0F) / 100.0F;
      float anaglyphBlue = (red * 30.0F + blue * 70.0F) / 100.0F;
      red = anaglyphRed;
      green = anaglyphGreen;
      blue = anaglyphBlue;
    }

    Icon iconGlass, iconStreaks, iconSide, iconOverlaySouth, iconOverlayWest;

    if (renderer.hasOverrideBlockTexture())
    {
      iconGlass = iconStreaks = iconSide =
      iconOverlaySouth = iconOverlayWest =
          renderer.overrideBlockTexture;
    }
    else
    {
      iconGlass = block.getIcon(0, metadata);
      iconStreaks = block.getIcon(0, 16 | metadata);
      iconSide = block.getSideTextureIndex();
      iconOverlaySouth = block.getBlockOverlayTexture(blockAccess, x, y, z, 2);
      iconOverlayWest = block.getBlockOverlayTexture(blockAccess, x, y, z, 5);
    }

    double minXGlass = iconGlass.getMinU();
    double midXGlass = iconGlass.getInterpolatedU(8.0D);
    double maxXGlass = iconGlass.getMaxU();
    double minYGlass = iconGlass.getMinV();
    double maxYGlass = iconGlass.getMaxV();

    double minXStreaks = iconStreaks.getMinU();
    double midXStreaks = iconStreaks.getInterpolatedU(8.0D);
    double maxXStreaks = iconStreaks.getMaxU();
    double minYStreaks = iconStreaks.getMinV();
    double maxYStreaks = iconStreaks.getMaxV();

    double minXSide = iconSide.getInterpolatedU(7.0D);
    double maxXSide = iconSide.getInterpolatedU(9.0D);
    double minYSide = iconSide.getMinV();
    double midYSide = iconSide.getInterpolatedV(8.0D);
    double maxYSide = iconSide.getMaxV();

    double minXSouth = iconOverlaySouth.getMinU();
    double midXSouth = iconOverlaySouth.getInterpolatedU(8.0D);
    double maxXSouth = iconOverlaySouth.getMaxU();
    double minYSouth = iconOverlaySouth.getMinV();
    double maxYSouth = iconOverlaySouth.getMaxV();

    double minXWest = iconOverlayWest.getMinU();
    double midXWest = iconOverlayWest.getInterpolatedU(8.0D);
    double maxXWest = iconOverlayWest.getMaxU();
    double minYWest = iconOverlayWest.getMinV();
    double maxYWest = iconOverlayWest.getMaxV();

    double xMin = x;
    double xMid = x + 0.5D;
    double xMax = x + 1;

    double zMin = z;
    double zMid = z + 0.5D;
    double zMax = z + 1;

    double yMin = y;
    double yMax = y + 1;

    double vertSideZOffset = 0.001D;
    double vertSideXOffset = 0.002D;

    double negSideZOffset = xMid - 0.0625D;
    double posSideZOffset = xMid + 0.0625D;
    double negSideXOffset = zMid - 0.0625D;
    double posSideXOffset = zMid + 0.0625D;

    boolean connectedNegZ = block.canThisFactoryPaneConnectToThisBlockID(blockAccess.getBlockId(x, y, z - 1));
    boolean connectedPosZ = block.canThisFactoryPaneConnectToThisBlockID(blockAccess.getBlockId(x, y, z + 1));
    boolean connectedNegX = block.canThisFactoryPaneConnectToThisBlockID(blockAccess.getBlockId(x - 1, y, z));
    boolean connectedPosX = block.canThisFactoryPaneConnectToThisBlockID(blockAccess.getBlockId(x + 1, y, z));

    boolean renderTop = y >= worldHeight || block.shouldSideBeRendered(blockAccess, x, y + 1, z, 1);
    boolean renderBottom = y <= 0 || block.shouldSideBeRendered(blockAccess, x, y - 1, z, 0);

    if ((!connectedNegX || !connectedPosX) && (connectedNegX || connectedPosX || connectedNegZ || connectedPosZ))
    {
      if (connectedNegX && !connectedPosX)
      {
View Full Code Here

    conveyorBlock = new BlockConveyor(MFRConfig.conveyorBlockId.getInt());
    machineBlocks.put(0, new BlockFactoryMachine(MFRConfig.machineBlock0Id.getInt(), 0));
    machineBlocks.put(1, new BlockFactoryMachine(MFRConfig.machineBlock1Id.getInt(), 1));
    machineBlocks.put(2, new BlockFactoryMachine(MFRConfig.machineBlock2Id.getInt(), 2));
    factoryGlassBlock = new BlockFactoryGlass(MFRConfig.factoryGlassBlockId.getInt());
    factoryGlassPaneBlock = new BlockFactoryGlassPane(MFRConfig.factoryGlassPaneBlockId.getInt());
    factoryRoadBlock = new BlockFactoryRoad(MFRConfig.factoryRoadBlockId.getInt());
    factoryDecorativeBrickBlock = new BlockFactoryDecorativeBricks(MFRConfig.factoryDecorativeBrickBlockId.getInt());
    factoryDecorativeStoneBlock = new BlockDecorativeStone(MFRConfig.factoryDecorativeStoneBlockId.getInt());
    rubberWoodBlock = new BlockRubberWood(MFRConfig.rubberWoodBlockId.getInt());
    rubberLeavesBlock = new BlockRubberLeaves(MFRConfig.rubberLeavesBlockId.getInt());
View Full Code Here

  public void renderItem(ItemRenderType type, ItemStack item, Object... data)
  {
    RenderEngine renderEngine = Minecraft.getMinecraft().renderEngine;
    RenderBlocks renderer = (RenderBlocks)data[0];

    BlockFactoryGlassPane pane = (BlockFactoryGlassPane)Block.blocksList[((ItemBlock)item.getItem()).getBlockID()];

    GL11.glPushMatrix();
    GL11.glDisable(GL11.GL_CULL_FACE);

    Tessellator tessellator = Tessellator.instance;
View Full Code Here

TOP

Related Classes of powercrystals.minefactoryreloaded.block.BlockFactoryGlassPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.