コード例 #1
0
  private void renderOverlay(final SchematicWorld schematic, final boolean isRenderingSchematic) {
    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);

    final GeometryTessellator tessellator = GeometryTessellator.getInstance();
    tessellator.setTranslation(
        -ClientProxy.playerPosition.x,
        -ClientProxy.playerPosition.y,
        -ClientProxy.playerPosition.z);
    tessellator.setDelta(ConfigurationHandler.blockDelta);

    if (ClientProxy.isRenderingGuide) {
      tessellator.startQuads();
      tessellator.drawCuboid(ClientProxy.pointA, GeometryMasks.Quad.ALL, 0xBF0000, 0x3F);
      tessellator.drawCuboid(ClientProxy.pointB, GeometryMasks.Quad.ALL, 0x0000BF, 0x3F);
      tessellator.draw();
    }

    tessellator.startLines();
    if (ClientProxy.isRenderingGuide) {
      tessellator.drawCuboid(ClientProxy.pointA, GeometryMasks.Line.ALL, 0xBF0000, 0x3F);
      tessellator.drawCuboid(ClientProxy.pointB, GeometryMasks.Line.ALL, 0x0000BF, 0x3F);
      tessellator.drawCuboid(
          ClientProxy.pointMin, ClientProxy.pointMax, GeometryMasks.Line.ALL, 0x00BF00, 0x7F);
    }
    if (isRenderingSchematic) {
      this.tmp.set(
          schematic.position.x + schematic.getWidth() - 1,
          schematic.position.y + schematic.getHeight() - 1,
          schematic.position.z + schematic.getLength() - 1);
      tessellator.drawCuboid(schematic.position, this.tmp, GeometryMasks.Line.ALL, 0xBF00BF, 0x7F);
    }
    tessellator.draw();

    GlStateManager.depthMask(false);
    this.renderContainer.renderOverlay();
    GlStateManager.depthMask(true);

    GL11.glDisable(GL11.GL_LINE_SMOOTH);
    GlStateManager.disableBlend();
    GlStateManager.enableTexture2D();
  }