net.minecraft.client.render.WorldRenderer Java Examples

The following examples show how to use net.minecraft.client.render.WorldRenderer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RenderUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public static void drawFilledBox(Box box, float r, float g, float b, float a) {
gl11Setup();

Vec3d ren = renderPos();

      /* Fill */
      Tessellator tessellator = Tessellator.getInstance();
      BufferBuilder buffer = tessellator.getBufferBuilder();
      buffer.begin(5, VertexFormats.POSITION_COLOR);
      WorldRenderer.buildBox(buffer,
      		box.minX - ren.x, box.minY - ren.y, box.minZ - ren.z,
      		box.maxX - ren.x, box.maxY - ren.y, box.maxZ - ren.z, r, g, b, a/2f);
      tessellator.draw();
      
      /* Outline */
      WorldRenderer.drawBoxOutline(new Box(
      		box.minX - ren.x, box.minY - ren.y, box.minZ - ren.z,
      		box.maxX - ren.x, box.maxY - ren.y, box.maxZ - ren.z), r, g, b, a);

      gl11Cleanup();
  }
 
Example #2
Source File: RenderUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public static void drawFilledBox(Box box, float r, float g, float b, float a) {
gl11Setup();

      // Fill
      Tessellator tessellator = Tessellator.getInstance();
      BufferBuilder buffer = tessellator.getBuffer();
      buffer.begin(5, VertexFormats.POSITION_COLOR);
      WorldRenderer.drawBox(buffer,
      		box.minX, box.minY, box.minZ,
      		box.maxX, box.maxY, box.maxZ, r, g, b, a/2f);
      tessellator.draw();
      
      // Outline
      buffer.begin(3, VertexFormats.POSITION_COLOR);
      buffer.vertex(box.minX, box.minY, box.minZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.minX, box.minY, box.maxZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.maxX, box.minY, box.maxZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.maxX, box.minY, box.minZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.minX, box.minY, box.minZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.minX, box.maxY, box.minZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.maxX, box.maxY, box.minZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.maxX, box.maxY, box.maxZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.minX, box.maxY, box.maxZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.minX, box.maxY, box.minZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.minX, box.minY, box.maxZ).color(r, b, b, 0f).next();
      buffer.vertex(box.minX, box.maxY, box.maxZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.maxX, box.minY, box.maxZ).color(r, b, b, 0f).next();
      buffer.vertex(box.maxX, box.maxY, box.maxZ).color(r, b, b, a/2f).next();
      buffer.vertex(box.maxX, box.minY, box.minZ).color(r, b, b, 0f).next();
      buffer.vertex(box.maxX, box.maxY, box.minZ).color(r, b, b, a/2f).next();
      tessellator.draw();
      
      gl11Cleanup();
  }
 
Example #3
Source File: RenderUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public static void drawFilledBox(Box box, float r, float g, float b, float a) {
gl11Setup();

      // Fill
      Tessellator tessellator = Tessellator.getInstance();
      BufferBuilder buffer = tessellator.getBuffer();
      buffer.begin(5, VertexFormats.POSITION_COLOR);
      WorldRenderer.drawBox(buffer,
      		box.x1, box.y1, box.z1,
      		box.x2, box.y2, box.z2, r, g, b, a/2f);
      tessellator.draw();
      
      // Outline
      buffer.begin(3, VertexFormats.POSITION_COLOR);
      buffer.vertex(box.x1, box.y1, box.z1).color(r, b, b, a/2f).next();
      buffer.vertex(box.x1, box.y1, box.z2).color(r, b, b, a/2f).next();
      buffer.vertex(box.x2, box.y1, box.z2).color(r, b, b, a/2f).next();
      buffer.vertex(box.x2, box.y1, box.z1).color(r, b, b, a/2f).next();
      buffer.vertex(box.x1, box.y1, box.z1).color(r, b, b, a/2f).next();
      buffer.vertex(box.x1, box.y2, box.z1).color(r, b, b, a/2f).next();
      buffer.vertex(box.x2, box.y2, box.z1).color(r, b, b, a/2f).next();
      buffer.vertex(box.x2, box.y2, box.z2).color(r, b, b, a/2f).next();
      buffer.vertex(box.x1, box.y2, box.z2).color(r, b, b, a/2f).next();
      buffer.vertex(box.x1, box.y2, box.z1).color(r, b, b, a/2f).next();
      buffer.vertex(box.x1, box.y1, box.z2).color(r, b, b, 0f).next();
      buffer.vertex(box.x1, box.y2, box.z2).color(r, b, b, a/2f).next();
      buffer.vertex(box.x2, box.y1, box.z2).color(r, b, b, 0f).next();
      buffer.vertex(box.x2, box.y2, box.z2).color(r, b, b, a/2f).next();
      buffer.vertex(box.x2, box.y1, box.z1).color(r, b, b, 0f).next();
      buffer.vertex(box.x2, box.y2, box.z1).color(r, b, b, a/2f).next();
      tessellator.draw();
      
      gl11Cleanup();
  }