Search in sources :

Example 11 with WorldRenderer

use of net.minecraft.client.renderer.WorldRenderer in project CodeChickenLib by Chicken-Bones.

the class RenderUtils method drawCuboidOutline.

public static void drawCuboidOutline(Cuboid6 c) {
    WorldRenderer r = CCRenderState.startDrawing(3, DefaultVertexFormats.POSITION);
    r.pos(c.min.x, c.min.y, c.min.z).endVertex();
    r.pos(c.max.x, c.min.y, c.min.z).endVertex();
    r.pos(c.max.x, c.min.y, c.max.z).endVertex();
    r.pos(c.min.x, c.min.y, c.max.z).endVertex();
    r.pos(c.min.x, c.min.y, c.min.z).endVertex();
    CCRenderState.draw();
    CCRenderState.startDrawing(3, DefaultVertexFormats.POSITION);
    r.pos(c.min.x, c.max.y, c.min.z).endVertex();
    r.pos(c.max.x, c.max.y, c.min.z).endVertex();
    r.pos(c.max.x, c.max.y, c.max.z).endVertex();
    r.pos(c.min.x, c.max.y, c.max.z).endVertex();
    r.pos(c.min.x, c.max.y, c.min.z).endVertex();
    CCRenderState.draw();
    CCRenderState.startDrawing(1, DefaultVertexFormats.POSITION);
    r.pos(c.min.x, c.min.y, c.min.z).endVertex();
    r.pos(c.min.x, c.max.y, c.min.z).endVertex();
    r.pos(c.max.x, c.min.y, c.min.z).endVertex();
    r.pos(c.max.x, c.max.y, c.min.z).endVertex();
    r.pos(c.max.x, c.min.y, c.max.z).endVertex();
    r.pos(c.max.x, c.max.y, c.max.z).endVertex();
    r.pos(c.min.x, c.min.y, c.max.z).endVertex();
    r.pos(c.min.x, c.max.y, c.max.z).endVertex();
    CCRenderState.draw();
}
Also used : WorldRenderer(net.minecraft.client.renderer.WorldRenderer)

Example 12 with WorldRenderer

use of net.minecraft.client.renderer.WorldRenderer in project SecurityCraft by Geforce132.

the class SCEventHandler method drawNonStandardTexturedRect.

private void drawNonStandardTexturedRect(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight) {
    double z = 200;
    double f = 1F / (double) textureWidth;
    double f1 = 1F / (double) textureHeight;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.startDrawingQuads();
    worldrenderer.addVertexWithUV(x, y + height, z, u * f, (v + height) * f1);
    worldrenderer.addVertexWithUV(x + width, y + height, z, (u + width) * f, (v + height) * f1);
    worldrenderer.addVertexWithUV(x + width, y, z, (u + width) * f, v * f1);
    worldrenderer.addVertexWithUV(x, y, z, u * f, v * f1);
    tessellator.draw();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) WorldRenderer(net.minecraft.client.renderer.WorldRenderer)

Aggregations

WorldRenderer (net.minecraft.client.renderer.WorldRenderer)12 Tessellator (net.minecraft.client.renderer.Tessellator)8 Vector3 (codechicken.lib.vec.Vector3)1 Minecraft (net.minecraft.client.Minecraft)1 FontRenderer (net.minecraft.client.gui.FontRenderer)1 RenderManager (net.minecraft.client.renderer.entity.RenderManager)1 Vec3 (net.minecraft.util.Vec3)1 DisplaySettings (watson.DisplaySettings)1 BlockEdit (watson.db.BlockEdit)1