Example #1
0
 public void renderCovers(IBlockAccess iba, TileLogic tl) {
   if (tl.Cover != 255) {
     super.context.setPos(tl.xCoord, tl.yCoord, tl.zCoord);
     super.context.readGlobalLights(iba, tl.xCoord, tl.yCoord, tl.zCoord);
     this.renderCover(tl.Rotation, tl.Cover);
   }
 }
Example #2
0
 public void setMatrixDisplayTick(int i, int j, int k, int rot, Random random) {
   float x = i + 0.5F + (random.nextFloat() - 0.5F) * 0.2F;
   float y = j + 0.7F + (random.nextFloat() - 0.5F) * 0.2F;
   float z = k + 0.5F + (random.nextFloat() - 0.5F) * 0.2F;
   super.context.setOrientation(0, rot);
   super.context.setPos(x, y, z);
 }
Example #3
0
 public void renderChip(double x, double y, double z, int tex) {
   // super.context.bindTexture("/eloraam/logic/logic1.png");
   super.context.setTexFlags(0);
   super.context.setRelPos(x, y, z);
   super.context.setIcon(getIcon(0, 0));
   super.context.setLocalLights(0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F);
   super.context.renderBox(62, 0.375D, 0.0625D, 0.375D, 0.625D, 0.1875D, 0.625D);
   // super.context.unbindTexture();
 }
Example #4
0
  @Override
  public void renderWorldBlock(
      RenderBlocks renderblocks, IBlockAccess iba, int i, int j, int k, int md) {
    TileLogic tl = (TileLogic) CoreLib.getTileEntity(iba, i, j, k, TileLogic.class);
    if (tl != null) {
      Tessellator tess = Tessellator.instance;
      tess.draw();

      // this.renderCovers(iba, tl);
      super.context.setBrightness(super.block.getMixedBrightnessForBlock(iba, i, j, k));
      this.setMatrixWorld(i, j, k, tl.Rotation);
      this.renderWorldPart(iba, tl);
      int ts = this.getTorchState(tl);
      RenderLogic.TorchPos[] tpv = this.getTorchVectors(tl);
      if (tpv != null) {
        for (int n = 0; n < tpv.length; ++n) { // TODO: .
          // IIcon icon = (ts & 1 << n) > 0 ? super.block.getIcon(0, md) :super.block.getIcon(1,
          // md);
          this.renderRedstoneTorch(tpv[n].x, tpv[n].y, tpv[n].z, tpv[n].h, (ts & 1 << n) > 0);
        }
      }

      this.context.bindBlockTexture();
      tess.startDrawingQuads();
    }
  }
Example #5
0
  public void renderInvWafer(int tx) {
    super.context.useNormal = true;
    /*switch (tx >> 8) {
    	default: //case 0:
    		Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("rplogic", "textures/blocks/logic1.png"));
    		icns = CoreProxyClient.logicIcons1;
    		break;
    	case 1:
    		Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("rplogic", "textures/blocks/logic2.png"));
    		icns = CoreProxyClient.logicIcons2;
    		break;
    	case 2:
    		Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("rplogic", "textures/blocks/sensor1.png"));
    		icns = CoreProxyClient.sensorIcons;
    }

    tx &= 255;*/
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    super.context.setTint(1.0F, 1.0F, 1.0F);
    super.context.setTexFlags(0);
    super.context.setSize(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D);
    super.context.setIcon(null, getIcon(0, 0), null, null, null, null);
    super.context.calcBounds();
    super.context.setLocalLights(0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F);
    super.context.renderFaces(63);
    tessellator.draw();
    // RenderLib.setDefaultTexture();
    super.context.useNormal = false;
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
  }
Example #6
0
 public void renderWafer(int tx) {
   tx &= 255;
   super.context.setRelPos(0.0D, 0.0D, 0.0D);
   super.context.setTint(1.0F, 1.0F, 1.0F);
   super.context.setTexFlags(0);
   super.context.setSize(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D);
   super.context.setIcon(null, getIcon(0, 0), null, null, null, null);
   super.context.calcBounds();
   super.context.setLocalLights(0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F);
   super.context.renderFaces(62);
   // super.context.unbindTexture();
 }
Example #7
0
 public void renderCover(int rot, int cov) {
   if (cov != 255) {
     rot >>= 2;
     rot ^= 1;
     short[] rs = new short[] {(short) 0, (short) 0, (short) 0, (short) 0, (short) 0, (short) 0};
     rs[rot] = (short) cov;
     super.context.setTint(1.0F, 1.0F, 1.0F);
     this.renderCovers(1 << rot, rs);
   }
 }
Example #8
0
  @Override
  public void renderInvBlock(RenderBlocks renderblocks, int md) {
    super.block.setBlockBoundsForItemRender();
    super.context.setDefaults();
    this.setMatrixInv();
    this.renderInvPart(md);
    GL11.glDisable(2896);
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    int ts = this.getInvTorchState(md);
    RenderLogic.TorchPos[] tpv = this.getInvTorchVectors(md);
    if (tpv != null) {
      for (int n = 0; n < tpv.length; ++n) {
        this.renderRedstoneTorch(tpv[n].x, tpv[n].y, tpv[n].z, tpv[n].h, (ts & 1 << n) > 0);
      }
    }

    tessellator.draw();
    GL11.glEnable(2896);
  }
Example #9
0
 public void setMatrixInv() {
   super.context.setOrientation(0, 3);
   super.context.setPos(-0.5D, -0.5D, -0.5D);
 }
Example #10
0
 public void setMatrixWorld(int x, int y, int z, int rot) {
   super.context.setOrientation(rot >> 2, rot & 3);
   super.context.setPos(x, y, z);
 }
Example #11
0
 public void renderTorchPuff(World world, String name, double x, double y, double z) {
   Vector3 v = new Vector3(x, y, z);
   super.context.basis.rotate(v);
   v.add(super.context.globalOrigin);
   world.spawnParticle(name, v.x, v.y, v.z, 0.0D, 0.0D, 0.0D);
 }
Example #12
0
  public void renderRedstoneTorch(double x, double y, double z, double h, boolean state) {
    IIcon tex = Blocks.unlit_redstone_torch.getBlockTextureFromSide(1);
    if (state) {
      tex = Blocks.redstone_torch.getBlockTextureFromSide(1);
    }

    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);

    super.context.setTexFlags(0);
    super.context.setRelPos(x, y, z);
    super.context.setIcon(tex);
    super.context.setLocalLights(1.0F);
    super.context.setTint(1.0F, 1.0F, 1.0F);
    super.context.setSize(0.4375D, 1.0D - h, 0.0D, 0.5625D, 1.0D, 1.0D);
    super.context.calcBounds();
    super.context.renderFaces(48);
    super.context.setSize(0.0D, 1.0D - h, 0.4375D, 1.0D, 1.0D, 0.5625D);
    super.context.calcBounds();
    super.context.renderFaces(12);
    super.context.setSize(0.375D, 0.0D, 0.4375D, 0.5D, 1.0D, 0.5625D);
    super.context.setRelPos(x + 0.0625D, y - 0.375D, z);
    super.context.calcBounds();
    super.context.setTexFlags(24);
    super.context.renderFaces(2);
    super.context.setRelPos(0.0D, 0.0D, 0.0D);
  }