Search in sources :

Example 16 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.

the class SkyRenderer method renderClouds.

@SideOnly(Side.CLIENT)
public static void renderClouds(GenericWorldProvider provider, DimensionInformation information, float partialTicks) {
    GlStateManager.disableCull();
    Minecraft mc = Minecraft.getMinecraft();
    TextureManager renderEngine = mc.getTextureManager();
    float f1 = (float) (mc.getRenderViewEntity().lastTickPosY + (mc.getRenderViewEntity().posY - mc.getRenderViewEntity().lastTickPosY) * partialTicks);
    Tessellator tessellator = Tessellator.getInstance();
    float f2 = 12.0F;
    float f3 = 4.0F;
    RenderGlobal renderGlobal = mc.renderGlobal;
    double d0 = (CloudRenderAccessHelper.getCloudTickCounter(renderGlobal) + partialTicks);
    double entityX = mc.getRenderViewEntity().prevPosX + (mc.getRenderViewEntity().posX - mc.getRenderViewEntity().prevPosX) * partialTicks;
    double entityZ = mc.getRenderViewEntity().prevPosZ + (mc.getRenderViewEntity().posZ - mc.getRenderViewEntity().prevPosZ) * partialTicks;
    double d1 = (entityX + d0 * 0.029999999329447746D) / f2;
    double d2 = entityZ / f2 + 0.33000001311302185D;
    float y = provider.getCloudHeight() - f1 + 0.33F;
    int i = MathTools.floor(d1 / 2048.0D);
    int j = MathTools.floor(d2 / 2048.0D);
    d1 -= (i * 2048);
    d2 -= (j * 2048);
    renderEngine.bindTexture(locationCloudsPng);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    Vec3d vec3 = provider.getWorld().getCloudColour(partialTicks);
    float red = (float) vec3.xCoord;
    float green = (float) vec3.yCoord;
    float blue = (float) vec3.zCoord;
    float f8;
    float f9;
    float f10;
    if (mc.gameSettings.anaglyph) {
        f8 = (red * 30.0F + green * 59.0F + blue * 11.0F) / 100.0F;
        f9 = (red * 30.0F + green * 70.0F) / 100.0F;
        f10 = (red * 30.0F + blue * 70.0F) / 100.0F;
        red = f8;
        green = f9;
        blue = f10;
    }
    f10 = 0.00390625F;
    f8 = MathTools.floor(d1) * f10;
    f9 = MathTools.floor(d2) * f10;
    float f11 = (float) (d1 - MathTools.floor(d1));
    float f12 = (float) (d2 - MathTools.floor(d2));
    byte b0 = 8;
    byte b1 = 4;
    float f13 = 9.765625E-4F;
    GlStateManager.scale(f2, 1.0F, f2);
    float cr = information.getSkyDescriptor().getCloudColorFactorR();
    float cg = information.getSkyDescriptor().getCloudColorFactorG();
    float cb = information.getSkyDescriptor().getCloudColorFactorB();
    boolean randomColors = information.isPatreonBitSet(Patreons.PATREON_KENNEY);
    VertexBuffer renderer = tessellator.getBuffer();
    for (int k = 0; k < 2; ++k) {
        if (k == 0) {
            GlStateManager.colorMask(false, false, false, false);
        } else if (mc.gameSettings.anaglyph) {
            if (EntityRenderer.anaglyphField == 0) {
                GlStateManager.colorMask(false, true, true, true);
            } else {
                GlStateManager.colorMask(true, false, false, true);
            }
        } else {
            GlStateManager.colorMask(true, true, true, true);
        }
        for (int l = -b1 + 1; l <= b1; ++l) {
            for (int i1 = -b1 + 1; i1 <= b1; ++i1) {
                renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
                float u = (l * b0);
                float v = (i1 * b0);
                float x = u - f11;
                float z = v - f12;
                if (randomColors) {
                    //                        cr = (float) ((u % 10.0f) / 10.0f);
                    //                        cg = (float) (((u + v) % 10.0f) / 10.0f);
                    //                        cb = (float) ((v % 10.0f) / 10.0f);
                    cr = x % 1.0f;
                    cg = (x + z) % 1.0f;
                    cb = z % 1.0f;
                }
                if (y > -f3 - 1.0F) {
                    renderer.pos((x + 0.0F), (y + 0.0F), (z + b0)).tex(((u + 0.0F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.7F * cr, green * 0.7F * cg, blue * 0.7F * cb, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
                    renderer.pos((x + b0), (y + 0.0F), (z + b0)).tex(((u + b0) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.7F * cr, green * 0.7F * cg, blue * 0.7F * cb, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
                    renderer.pos((x + b0), (y + 0.0F), (z + 0.0F)).tex(((u + b0) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.7F * cr, green * 0.7F * cg, blue * 0.7F * cb, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
                    renderer.pos((x + 0.0F), (y + 0.0F), (z + 0.0F)).tex(((u + 0.0F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.7F * cr, green * 0.7F * cg, blue * 0.7F * cb, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
                }
                if (y <= f3 + 1.0F) {
                    renderer.pos((x + 0.0F), (y + f3 - f13), (z + b0)).tex(((u + 0.0F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * cr, green * cg, blue * cb, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
                    renderer.pos((x + b0), (y + f3 - f13), (z + b0)).tex(((u + b0) * f10 + f8), ((v + b0) * f10 + f9)).color(red * cr, green * cg, blue * cb, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
                    renderer.pos((x + b0), (y + f3 - f13), (z + 0.0F)).tex(((u + b0) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * cr, green * cg, blue * cb, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
                    renderer.pos((x + 0.0F), (y + f3 - f13), (z + 0.0F)).tex(((u + 0.0F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * cr, green * cg, blue * cb, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
                }
                int j1;
                if (l > -1) {
                    for (j1 = 0; j1 < b0; ++j1) {
                        renderer.pos((x + j1 + 0.0F), (y + 0.0F), (z + b0)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 0.0F), (y + f3), (z + b0)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 0.0F), (y + f3), (z + 0.0F)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 0.0F), (y + 0.0F), (z + 0.0F)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
                    }
                }
                if (l <= 1) {
                    for (j1 = 0; j1 < b0; ++j1) {
                        renderer.pos((x + j1 + 1.0F - f13), (y + 0.0F), (z + b0)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 1.0F - f13), (y + f3), (z + b0)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 1.0F - f13), (y + f3), (z + 0.0F)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 1.0F - f13), (y + 0.0F), (z + 0.0F)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
                    }
                }
                if (i1 > -1) {
                    for (j1 = 0; j1 < b0; ++j1) {
                        renderer.pos((x + 0.0F), (y + f3), (z + j1 + 0.0F)).tex(((u + 0.0F) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
                        renderer.pos((x + b0), (y + f3), (z + j1 + 0.0F)).tex(((u + b0) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
                        renderer.pos((x + b0), (y + 0.0F), (z + j1 + 0.0F)).tex(((u + b0) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
                        renderer.pos((x + 0.0F), (y + 0.0F), (z + j1 + 0.0F)).tex(((u + 0.0F) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
                    }
                }
                if (i1 <= 1) {
                    for (j1 = 0; j1 < b0; ++j1) {
                        renderer.pos((x + 0.0F), (y + f3), (z + j1 + 1.0F - f13)).tex(((u + 0.0F) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
                        renderer.pos((x + b0), (y + f3), (z + j1 + 1.0F - f13)).tex(((u + b0) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
                        renderer.pos((x + b0), (y + 0.0F), (z + j1 + 1.0F - f13)).tex(((u + b0) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
                        renderer.pos((x + 0.0F), (y + 0.0F), (z + j1 + 1.0F - f13)).tex(((u + 0.0F) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
                    }
                }
                tessellator.draw();
            }
        }
    }
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableBlend();
    GlStateManager.enableCull();
}
Also used : TextureManager(net.minecraft.client.renderer.texture.TextureManager) Minecraft(net.minecraft.client.Minecraft) Vec3d(net.minecraft.util.math.Vec3d) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 17 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.

the class SkyRenderer method renderSky.

/**
     * Renders the sky with the partial tick time. Args: partialTickTime
     */
@SideOnly(Side.CLIENT)
private static void renderSky(float partialTickTime, DimensionInformation information) {
    initialize();
    EntityPlayerSP player = MinecraftTools.getPlayer(Minecraft.getMinecraft());
    WorldClient world = MinecraftTools.getWorld(Minecraft.getMinecraft());
    TextureManager renderEngine = Minecraft.getMinecraft().getTextureManager();
    GlStateManager.disableTexture2D();
    Vec3d vec3 = world.getSkyColor(player, partialTickTime);
    float skyRed = (float) vec3.xCoord;
    float skyGreen = (float) vec3.yCoord;
    float skyBlue = (float) vec3.zCoord;
    boolean anaglyph = Minecraft.getMinecraft().gameSettings.anaglyph;
    if (anaglyph) {
        float f4 = (skyRed * 30.0F + skyGreen * 59.0F + skyBlue * 11.0F) / 100.0F;
        float f5 = (skyRed * 30.0F + skyGreen * 70.0F) / 100.0F;
        float f6 = (skyRed * 30.0F + skyBlue * 70.0F) / 100.0F;
        skyRed = f4;
        skyGreen = f5;
        skyBlue = f6;
    }
    GlStateManager.color(skyRed, skyGreen, skyBlue);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer renderer = tessellator.getBuffer();
    GlStateManager.depthMask(false);
    GlStateManager.enableFog();
    GlStateManager.color(skyRed, skyGreen, skyBlue);
    // @todo support VBO?
    //        if (OpenGlHelper.useVbo()) {
    //            skyVBO.bindBuffer();
    //            GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
    //            GL11.glVertexPointer(3, GL11.GL_FLOAT, 12, 0L);
    //            this.skyVBO.drawArrays(7);
    //            this.skyVBO.unbindBuffer();
    //            GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
    //
    //        } else {
    GlStateManager.callList(glSkyList);
    //        }
    GlStateManager.disableFog();
    GlStateManager.disableAlpha();
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    RenderHelper.disableStandardItemLighting();
    float[] sunsetColors = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTickTime), partialTickTime);
    if (sunsetColors != null) {
        GlStateManager.disableTexture2D();
        GlStateManager.shadeModel(7425);
        GlStateManager.pushMatrix();
        GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(MathHelper.sin(world.getCelestialAngleRadians(partialTickTime)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F);
        GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
        float f6 = sunsetColors[0];
        float f7 = sunsetColors[1];
        float f8 = sunsetColors[2];
        if (anaglyph) {
            float f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F;
            float f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F;
            float f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F;
            f6 = f9;
            f7 = f10;
            f8 = f11;
        }
        renderer.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR);
        renderer.pos(0.0D, 100.0D, 0.0D).color(f6, f7, f8, sunsetColors[3]).endVertex();
        for (int j = 0; j <= 16; ++j) {
            float f11 = j * (float) Math.PI * 2.0F / 16.0f;
            float f12 = MathHelper.sin(f11);
            float f13 = MathHelper.cos(f11);
            renderer.pos((f12 * 120.0F), (f13 * 120.0F), (-f13 * 40.0F * sunsetColors[3])).color(sunsetColors[0], sunsetColors[1], sunsetColors[2], 0.0F).endVertex();
        }
        tessellator.draw();
        GlStateManager.popMatrix();
        GlStateManager.shadeModel(GL11.GL_FLAT);
    }
    renderCelestialBodies(partialTickTime, information, world, renderEngine, tessellator);
    GlStateManager.color(0.0F, 0.0F, 0.0F);
    double d0 = player.getPosition().getY() - world.getHorizon();
    if (d0 < 0.0D) {
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 12.0F, 0.0F);
        // @todo
        //            if (this.vboEnabled)
        //            {
        //                this.sky2VBO.bindBuffer();
        //                GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
        //                GL11.glVertexPointer(3, GL11.GL_FLOAT, 12, 0L);
        //                this.sky2VBO.drawArrays(7);
        //                this.sky2VBO.unbindBuffer();
        //                GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
        //            }
        //            else
        //            {
        GlStateManager.callList(glSkyList2);
        //                GlStateManager.callList(this.glSkyList2);
        //            }
        GlStateManager.popMatrix();
        float f8 = 1.0F;
        float f9 = -((float) (d0 + 65.0D));
        float f10 = -f8;
        renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
        renderer.pos((-f8), f9, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f9, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f10, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos((-f8), f10, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos((-f8), f10, (-f8)).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f10, (-f8)).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f9, (-f8)).color(0, 0, 0, 255).endVertex();
        renderer.pos((-f8), f9, (-f8)).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f10, (-f8)).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f10, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f9, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f9, (-f8)).color(0, 0, 0, 255).endVertex();
        renderer.pos((-f8), f9, (-f8)).color(0, 0, 0, 255).endVertex();
        renderer.pos((-f8), f9, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos((-f8), f10, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos((-f8), f10, (-f8)).color(0, 0, 0, 255).endVertex();
        renderer.pos((-f8), f10, (-f8)).color(0, 0, 0, 255).endVertex();
        renderer.pos((-f8), f10, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f10, f8).color(0, 0, 0, 255).endVertex();
        renderer.pos(f8, f10, (-f8)).color(0, 0, 0, 255).endVertex();
        tessellator.draw();
    }
    if (world.provider.isSkyColored()) {
        GlStateManager.color(skyRed * 0.2F + 0.04F, skyGreen * 0.2F + 0.04F, skyBlue * 0.6F + 0.1F);
    } else {
        GlStateManager.color(skyRed, skyGreen, skyBlue);
    }
    GlStateManager.pushMatrix();
    GlStateManager.translate(0.0F, -((float) (d0 - 16.0D)), 0.0F);
    GlStateManager.callList(glSkyList2);
    GlStateManager.popMatrix();
    GlStateManager.enableTexture2D();
    GlStateManager.depthMask(true);
}
Also used : TextureManager(net.minecraft.client.renderer.texture.TextureManager) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP) WorldClient(net.minecraft.client.multiplayer.WorldClient) Vec3d(net.minecraft.util.math.Vec3d) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 18 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.

the class SkyRenderer method renderSkyTexture.

@SideOnly(Side.CLIENT)
private static void renderSkyTexture(ResourceLocation sky, ResourceLocation sky2, int type) {
    TextureManager renderEngine = Minecraft.getMinecraft().getTextureManager();
    GlStateManager.disableFog();
    GlStateManager.disableAlpha();
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    RenderHelper.disableStandardItemLighting();
    GlStateManager.depthMask(false);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer renderer = tessellator.getBuffer();
    for (int i = 0; i < 6; ++i) {
        GlStateManager.pushMatrix();
        UV[] uv = faceDown;
        boolean white = true;
        if (i == 0) {
            // Down face
            uv = faceDown;
            switch(type) {
                case SKYTYPE_ALL:
                    renderEngine.bindTexture(sky);
                    break;
                case SKYTYPE_ALLHORIZONTAL:
                case SKYTYPE_ALTERNATING:
                    renderEngine.bindTexture(sky2);
                    break;
                default:
                    white = false;
                    break;
            }
        } else if (i == 1) {
            // North face
            renderEngine.bindTexture(sky);
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            uv = faceNorth;
        } else if (i == 2) {
            // South face
            renderEngine.bindTexture(sky);
            GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F);
            uv = faceSouth;
        } else if (i == 3) {
            // Up face
            GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
            uv = faceUp;
            switch(type) {
                case SKYTYPE_ALL:
                    renderEngine.bindTexture(sky);
                    break;
                case SKYTYPE_ALLHORIZONTAL:
                case SKYTYPE_ALTERNATING:
                    renderEngine.bindTexture(sky2);
                    break;
                default:
                    white = false;
                    break;
            }
        } else if (i == 4) {
            // East face
            if (type == SKYTYPE_ALTERNATING && sky2 != null) {
                renderEngine.bindTexture(sky2);
            } else {
                renderEngine.bindTexture(sky);
            }
            GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
            uv = faceEast;
        } else if (i == 5) {
            // West face
            if (type == SKYTYPE_ALTERNATING && sky2 != null) {
                renderEngine.bindTexture(sky2);
            } else {
                renderEngine.bindTexture(sky);
            }
            GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F);
            uv = faceWest;
        }
        renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
        int cc = white ? 255 : 0;
        renderer.pos(-100.0D, -100.0D, -100.0D).tex(uv[0].u, uv[0].v).color(cc, cc, cc, 255).endVertex();
        renderer.pos(-100.0D, -100.0D, 100.0D).tex(uv[1].u, uv[1].v).color(cc, cc, cc, 255).endVertex();
        renderer.pos(100.0D, -100.0D, 100.0D).tex(uv[2].u, uv[2].v).color(cc, cc, cc, 255).endVertex();
        renderer.pos(100.0D, -100.0D, -100.0D).tex(uv[3].u, uv[3].v).color(cc, cc, cc, 255).endVertex();
        tessellator.draw();
        GlStateManager.popMatrix();
    }
    GlStateManager.depthMask(true);
    GlStateManager.enableTexture2D();
    GlStateManager.enableAlpha();
}
Also used : TextureManager(net.minecraft.client.renderer.texture.TextureManager) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 19 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project ImmersiveEngineering by BluSunrize.

the class TileEntitySampleDrill method getRenderBoundingBox.

@SideOnly(Side.CLIENT)
@Override
public AxisAlignedBB getRenderBoundingBox() {
    if (renderAABB == null)
        if (dummy == 0)
            renderAABB = new AxisAlignedBB(getPos(), getPos().add(1, 3, 1));
        else
            renderAABB = new AxisAlignedBB(getPos(), getPos());
    return renderAABB;
}
Also used : AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 20 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project ImmersiveEngineering by BluSunrize.

the class TileEntitySilo method getRenderBoundingBox.

@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
    if (renderAABB == null)
        if (pos == 4)
            renderAABB = new AxisAlignedBB(getPos().add(-1, 0, -1), getPos().add(2, 7, 2));
        else
            renderAABB = new AxisAlignedBB(getPos(), getPos());
    return renderAABB;
}
Also used : AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) IComparatorOverride(blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IComparatorOverride)

Aggregations

SideOnly (net.minecraftforge.fml.relauncher.SideOnly)175 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)42 ItemStack (net.minecraft.item.ItemStack)36 ResourceLocation (net.minecraft.util.ResourceLocation)30 IBlockState (net.minecraft.block.state.IBlockState)19 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)19 Block (net.minecraft.block.Block)17 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)13 EntityPlayer (net.minecraft.entity.player.EntityPlayer)11 ItemMeshDefinition (net.minecraft.client.renderer.ItemMeshDefinition)9 BlockPos (net.minecraft.util.math.BlockPos)9 World (net.minecraft.world.World)9 TileEntity (net.minecraft.tileentity.TileEntity)8 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)8 Vec3d (net.minecraft.util.math.Vec3d)7 ArrayList (java.util.ArrayList)5 Minecraft (net.minecraft.client.Minecraft)5 Tessellator (net.minecraft.client.renderer.Tessellator)5 VertexBuffer (net.minecraft.client.renderer.VertexBuffer)5 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)5