diff --git a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java index 75b068016..265950bf3 100644 --- a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java @@ -220,10 +220,9 @@ public class ClientProxy extends CommonProxy { MinecraftForge.EVENT_BUS.register(new DebugHandler()); MinecraftForge.EVENT_BUS.register(new SubTileRadiusRenderHandler()); MinecraftForge.EVENT_BUS.register(new MultiblockRenderHandler()); + MinecraftForge.EVENT_BUS.register(new SkyblockRenderEvents()); FMLCommonHandler.instance().bus().register(new CorporeaAutoCompleteHandler()); - if(Botania.gardenOfGlassLoaded) - MinecraftForge.EVENT_BUS.register(new SkyblockRenderEvents()); if(ConfigHandler.useAdaptativeConfig) FMLCommonHandler.instance().bus().register(new AdaptorNotifier()); if(ConfigHandler.versionCheckEnabled) diff --git a/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java b/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java index 04cde0d03..007b637fb 100644 --- a/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java +++ b/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java @@ -13,6 +13,7 @@ package vazkii.botania.client.render.world; import net.minecraft.client.Minecraft; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; +import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.world.WorldTypeSkyblock; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -21,7 +22,7 @@ public final class SkyblockRenderEvents { @SubscribeEvent public void onRender(RenderWorldLastEvent event) { World world = Minecraft.getMinecraft().theWorld; - if(world.provider.dimensionId == 0/* && WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld)*/) { + if(ConfigHandler.enableFancySkybox && world.provider.dimensionId == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))) { if(!(world.provider.getSkyRenderer() instanceof SkyblockSkyRenderer)) world.provider.setSkyRenderer(new SkyblockSkyRenderer()); } diff --git a/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java b/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java index f8e252e78..64bef6bee 100644 --- a/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java +++ b/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java @@ -35,148 +35,150 @@ public class SkyblockSkyRenderer extends IRenderHandler { private static final ResourceLocation textureSkybox = new ResourceLocation(LibResources.MISC_SKYBOX); private static final ResourceLocation textureRainbow = new ResourceLocation(LibResources.MISC_RAINBOW); private static final ResourceLocation textureMoonPhases = new ResourceLocation("textures/environment/moon_phases.png"); - private static final ResourceLocation textureSun = new ResourceLocation("textures/environment/sun.png"); - private static final ResourceLocation[] planetTextures = new ResourceLocation[] { - new ResourceLocation(LibResources.MISC_PLANET + "0.png"), - new ResourceLocation(LibResources.MISC_PLANET + "1.png"), - new ResourceLocation(LibResources.MISC_PLANET + "2.png"), - new ResourceLocation(LibResources.MISC_PLANET + "3.png"), - new ResourceLocation(LibResources.MISC_PLANET + "4.png"), - new ResourceLocation(LibResources.MISC_PLANET + "5.png") - }; - + private static final ResourceLocation textureSun = new ResourceLocation("textures/environment/sun.png"); + private static final ResourceLocation[] planetTextures = new ResourceLocation[] { + new ResourceLocation(LibResources.MISC_PLANET + "0.png"), + new ResourceLocation(LibResources.MISC_PLANET + "1.png"), + new ResourceLocation(LibResources.MISC_PLANET + "2.png"), + new ResourceLocation(LibResources.MISC_PLANET + "3.png"), + new ResourceLocation(LibResources.MISC_PLANET + "4.png"), + new ResourceLocation(LibResources.MISC_PLANET + "5.png") + }; + @Override public void render(float partialTicks, WorldClient world, Minecraft mc) { boolean test = false; if(test) return; - + int glSkyList = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.GL_SKY_LIST); - int glSkyList2 = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.GL_SKY_LIST2); // Horizon like. We don't have it here + int glSkyList2 = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.GL_SKY_LIST2); // Horizon line. We don't have it here int starGLCallList = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.STAR_GL_CALL_LIST); - GL11.glDisable(GL11.GL_TEXTURE_2D); - Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, partialTicks); - float f1 = (float)vec3.xCoord; - float f2 = (float)vec3.yCoord; - float f3 = (float)vec3.zCoord; - float f6; - - int startFade = 25; - float insideVoid = Math.max(0F, ((float) (startFade - mc.thePlayer.posY) / startFade)); - f1 = Math.max(0F, f1 - insideVoid); - f2 = Math.max(0F, f2 - insideVoid); - f3 = Math.max(0F, f3 - insideVoid); + GL11.glDisable(GL11.GL_TEXTURE_2D); + Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, partialTicks); + float f1 = (float)vec3.xCoord; + float f2 = (float)vec3.yCoord; + float f3 = (float)vec3.zCoord; + float f6; - Tessellator tessellator1 = Tessellator.instance; - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_FOG); - GL11.glColor3f(f1, f2, f3); - GL11.glCallList(glSkyList); - GL11.glDisable(GL11.GL_FOG); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.glBlendFunc(770, 771, 1, 0); - RenderHelper.disableStandardItemLighting(); - float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTicks), partialTicks); - float f7; - float f8; - float f9; - float f10; + int startFade = 25; + float insideVoid = Math.max(0F, ((float) (startFade - mc.thePlayer.posY) / startFade)); + f1 = Math.max(0F, f1 - insideVoid); + f2 = Math.max(0F, f2 - insideVoid); + f3 = Math.max(0F, f3 - insideVoid); - // === Sunset - if(afloat != null) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glPushMatrix(); - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); - f6 = afloat[0]; - f7 = afloat[1]; - f8 = afloat[2]; - float f11; + Tessellator tessellator1 = Tessellator.instance; + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_FOG); + GL11.glColor3f(f1, f2, f3); + GL11.glCallList(glSkyList); + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + RenderHelper.disableStandardItemLighting(); + float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTicks), partialTicks); + float f7; + float f8; + float f9; + float f10; - tessellator1.startDrawing(6); - tessellator1.setColorRGBA_F(f6, f7, f8, afloat[3] * (1F - insideVoid)); - tessellator1.addVertex(0.0D, 100.0D, 0.0D); - byte b0 = 16; - tessellator1.setColorRGBA_F(afloat[0], afloat[1], afloat[2], 0.0F); + // === Sunset + if(afloat != null) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glPushMatrix(); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + f6 = afloat[0]; + f7 = afloat[1]; + f8 = afloat[2]; + float f11; - for(int j = 0; j <= b0; ++j) { - f11 = (float)j * (float)Math.PI * 2.0F / (float)b0; - float f12 = MathHelper.sin(f11); - float f13 = MathHelper.cos(f11); - tessellator1.addVertex((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3])); - } + tessellator1.startDrawing(6); + tessellator1.setColorRGBA_F(f6, f7, f8, afloat[3] * (1F - insideVoid)); + tessellator1.addVertex(0.0D, 100.0D, 0.0D); + byte b0 = 16; + tessellator1.setColorRGBA_F(afloat[0], afloat[1], afloat[2], 0.0F); - tessellator1.draw(); - GL11.glPopMatrix(); - GL11.glShadeModel(GL11.GL_FLAT); - } + for(int j = 0; j <= b0; ++j) { + f11 = (float)j * (float)Math.PI * 2.0F / (float)b0; + float f12 = MathHelper.sin(f11); + float f13 = MathHelper.cos(f11); + tessellator1.addVertex((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3])); + } - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glPushMatrix(); - f6 = Math.max(0.2F, 1.0F - world.getRainStrength(partialTicks)) * (1F - insideVoid); - f7 = 0.0F; - f8 = 0.0F; - f9 = 0.0F; - - GL11.glTranslatef(f7, f8, f9); - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - - float celAng = world.getCelestialAngle(partialTicks); - float effCelAng = celAng; - if(celAng > 0.5) - effCelAng = 0.5F - (celAng - 0.5F); - - // === Planets - f10 = 20F; - float a = Math.max(0F, effCelAng - 0.3F) * f6; + tessellator1.draw(); + GL11.glPopMatrix(); + GL11.glShadeModel(GL11.GL_FLAT); + } - OpenGlHelper.glBlendFunc(770, 771, 1, 0); - GL11.glPushMatrix(); - GL11.glColor4f(1F, 1F, 1F, a * 4); - GL11.glRotatef(90F, 0.5F, 0.5F, 0.0F); - for(int p = 0; p < planetTextures.length; p++) { - mc.renderEngine.bindTexture(planetTextures[p]); - drawObject(tessellator1, f10); - - switch(p) { - case 0: - GL11.glRotatef(70F, 1F, 0F, 0F); - f10 = 12F; - break; - case 1: - GL11.glRotatef(120F, 0F, 0F, 1F); - f10 = 15F; - break; - case 2: - GL11.glRotatef(80F, 1F, 0F, 1F); - f10 = 25F; - break; - case 3: - GL11.glRotatef(100F, 0F, 0F, 1F); - f10 = 10F; - break; - case 4: - GL11.glRotatef(-60F, 1F, 0F, 0.5F); - f10 = 40F; - } - } - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glPopMatrix(); - - // === Rays - mc.renderEngine.bindTexture(textureSkybox); - - f10 = 20F; - GL11.glPushMatrix(); - OpenGlHelper.glBlendFunc(770, 1, 1, 0); - GL11.glTranslatef(0F, -1F, 0F); - GL11.glRotatef(220F, 1F, 0F, 0F); - GL11.glColor4f(1F, 1F, 1F, a); - int angles = 90; + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPushMatrix(); + f6 = Math.max(0.2F, 1.0F - world.getRainStrength(partialTicks)) * (1F - insideVoid); + f7 = 0.0F; + f8 = 0.0F; + f9 = 0.0F; + + GL11.glTranslatef(f7, f8, f9); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + + float celAng = world.getCelestialAngle(partialTicks); + float effCelAng = celAng; + if(celAng > 0.5) + effCelAng = 0.5F - (celAng - 0.5F); + + // === Planets + f10 = 20F; + float lowA = Math.max(0F, effCelAng - 0.3F) * f6; + float a = Math.max(0.1F, lowA); + + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glPushMatrix(); + GL11.glColor4f(1F, 1F, 1F, a * 4); + GL11.glRotatef(90F, 0.5F, 0.5F, 0.0F); + for(int p = 0; p < planetTextures.length; p++) { + mc.renderEngine.bindTexture(planetTextures[p]); + drawObject(tessellator1, f10); + + switch(p) { + case 0: + GL11.glRotatef(70F, 1F, 0F, 0F); + f10 = 12F; + break; + case 1: + GL11.glRotatef(120F, 0F, 0F, 1F); + f10 = 15F; + break; + case 2: + GL11.glRotatef(80F, 1F, 0F, 1F); + f10 = 25F; + break; + case 3: + GL11.glRotatef(100F, 0F, 0F, 1F); + f10 = 10F; + break; + case 4: + GL11.glRotatef(-60F, 1F, 0F, 0.5F); + f10 = 40F; + } + } + GL11.glColor4f(1F, 1F, 1F, 1F); + GL11.glPopMatrix(); + + // === Rays + mc.renderEngine.bindTexture(textureSkybox); + + f10 = 20F; + a = lowA; + GL11.glPushMatrix(); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + GL11.glTranslatef(0F, -1F, 0F); + GL11.glRotatef(220F, 1F, 0F, 0F); + GL11.glColor4f(1F, 1F, 1F, a); + int angles = 90; float s = 3F; float m = 1F; float y = 2F; @@ -186,81 +188,81 @@ public class SkyblockSkyRenderer extends IRenderHandler { double fuzzPer = (Math.PI * 10) / angles; float rotSpeed = 1F; float rotSpeedMod = 0.4F; - + for(int p = 0; p < 3; p++) { float baseAngle = rotSpeed * rotSpeedMod * (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks); GL11.glRotatef((ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.25F * rotSpeed * rotSpeedMod, 0F, 1F, 0F); - - tessellator1.startDrawingQuads(); + + tessellator1.startDrawingQuads(); for(int i = 0; i < angles; i++) { int j = i; if(i % 2 == 0) j--; - + float ang = j * anglePer + baseAngle; double xp = Math.cos(ang * Math.PI / 180F) * f10; double zp = Math.sin(ang * Math.PI / 180F) * f10; double yo = Math.sin(fuzzPer * j) * 1; - + float ut = ang * uPer; if(i % 2 == 0) { tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); - tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); + tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); } else { - tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); - tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); + tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); + tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); } } tessellator1.draw(); switch(p) { - case 0: - GL11.glRotatef(20F, 1F, 0F, 0F); - GL11.glColor4f(1F, 0.4F, 0.4F, a); - fuzzPer = (Math.PI * 14) / angles; - rotSpeed = 0.2F; - break; - case 1: - GL11.glRotatef(50F, 1F, 0F, 0F); - GL11.glColor4f(0.4F, 1F, 0.7F, a); - fuzzPer = (Math.PI * 6) / angles; - rotSpeed = 2F; - break; + case 0: + GL11.glRotatef(20F, 1F, 0F, 0F); + GL11.glColor4f(1F, 0.4F, 0.4F, a); + fuzzPer = (Math.PI * 14) / angles; + rotSpeed = 0.2F; + break; + case 1: + GL11.glRotatef(50F, 1F, 0F, 0F); + GL11.glColor4f(0.4F, 1F, 0.7F, a); + fuzzPer = (Math.PI * 6) / angles; + rotSpeed = 2F; + break; } } GL11.glPopMatrix(); - + // === Rainbow GL11.glPushMatrix(); - OpenGlHelper.glBlendFunc(770, 771, 1, 0); - mc.renderEngine.bindTexture(textureRainbow); - f10 = 10F; - float effCelAng1 = celAng; - if(effCelAng1 > 0.25F) - effCelAng1 = 1F - effCelAng1; - effCelAng1 = 0.25F - Math.min(0.25F, effCelAng1); - - long time = world.getWorldTime() + 1000; - int day = (int) (time / 24000L); - Random rand = new Random(("" + day).hashCode()); - float angle1 = rand.nextFloat() * 360F; - float angle2 = rand.nextFloat() * 360F; - GL11.glColor4f(1F, 1F, 1F, effCelAng1); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + mc.renderEngine.bindTexture(textureRainbow); + f10 = 10F; + float effCelAng1 = celAng; + if(effCelAng1 > 0.25F) + effCelAng1 = 1F - effCelAng1; + effCelAng1 = 0.25F - Math.min(0.25F, effCelAng1); + + long time = world.getWorldTime() + 1000; + int day = (int) (time / 24000L); + Random rand = new Random(day * 0xFF); + float angle1 = rand.nextFloat() * 360F; + float angle2 = rand.nextFloat() * 360F; + GL11.glColor4f(1F, 1F, 1F, effCelAng1 * (1F - insideVoid)); GL11.glRotatef(angle1, 0F, 1F, 0F); GL11.glRotatef(angle2, 0F, 0F, 1F); - tessellator1.startDrawingQuads(); + tessellator1.startDrawingQuads(); for(int i = 0; i < angles; i++) { int j = i; if(i % 2 == 0) j--; - + float ang = j * anglePer; double xp = Math.cos(ang * Math.PI / 180F) * f10; double zp = Math.sin(ang * Math.PI / 180F) * f10; double yo = 0; - + float ut = ang * uPer; if(i % 2 == 0) { tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); @@ -275,92 +277,92 @@ public class SkyblockSkyRenderer extends IRenderHandler { GL11.glPopMatrix(); GL11.glColor4f(1F, 1F, 1F, 1F - insideVoid); - - OpenGlHelper.glBlendFunc(770, 1, 1, 0); - - // === Sun - GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); - f10 = 60.0F; - mc.renderEngine.bindTexture(textureSun); - drawObject(tessellator1, f10); - - // === Moon - f10 = 60.0F; - mc.renderEngine.bindTexture(textureMoonPhases); - int k = world.getMoonPhase(); - int l = k % 4; - int i1 = k / 4 % 2; - float f14 = (float)(l + 0) / 4.0F; - float f15 = (float)(i1 + 0) / 2.0F; - float f16 = (float)(l + 1) / 4.0F; - float f17 = (float)(i1 + 1) / 2.0F; - tessellator1.startDrawingQuads(); - tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)f10, (double)f16, (double)f17); - tessellator1.addVertexWithUV((double)f10, -100.0D, (double)f10, (double)f14, (double)f17); - tessellator1.addVertexWithUV((double)f10, -100.0D, (double)(-f10), (double)f14, (double)f15); - tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)(-f10), (double)f16, (double)f15); - tessellator1.draw(); - - // === Stars - f6 *= Math.max(0.1F, effCelAng * 2); - float t = (ClientTickHandler.ticksInGame + partialTicks + 2000) * 0.005F; - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_TEXTURE_2D); - - GL11.glPushMatrix(); - GL11.glRotatef(t * 3, 0F, 1F, 0F); + + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + + // === Sun + GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); + f10 = 60.0F; + mc.renderEngine.bindTexture(textureSun); + drawObject(tessellator1, f10); + + // === Moon + f10 = 60.0F; + mc.renderEngine.bindTexture(textureMoonPhases); + int k = world.getMoonPhase(); + int l = k % 4; + int i1 = k / 4 % 2; + float f14 = (float)(l + 0) / 4.0F; + float f15 = (float)(i1 + 0) / 2.0F; + float f16 = (float)(l + 1) / 4.0F; + float f17 = (float)(i1 + 1) / 2.0F; + tessellator1.startDrawingQuads(); + tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)f10, (double)f16, (double)f17); + tessellator1.addVertexWithUV((double)f10, -100.0D, (double)f10, (double)f14, (double)f17); + tessellator1.addVertexWithUV((double)f10, -100.0D, (double)(-f10), (double)f14, (double)f15); + tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)(-f10), (double)f16, (double)f15); + tessellator1.draw(); + + // === Stars + f6 *= Math.max(0.1F, effCelAng * 2); + float t = (ClientTickHandler.ticksInGame + partialTicks + 2000) * 0.005F; + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + GL11.glPushMatrix(); + GL11.glRotatef(t * 3, 0F, 1F, 0F); GL11.glColor4f(1F, 1F, 1F, f6); GL11.glCallList(starGLCallList); GL11.glPopMatrix(); - + GL11.glPushMatrix(); - GL11.glRotatef(t, 0F, 1F, 0F); - GL11.glColor4f(0.5F, 1F, 1F, f6); + GL11.glRotatef(t, 0F, 1F, 0F); + GL11.glColor4f(0.5F, 1F, 1F, f6); GL11.glCallList(starGLCallList); GL11.glPopMatrix(); - + GL11.glPushMatrix(); - GL11.glRotatef(t * 2, 0F, 1F, 0F); - GL11.glColor4f(1F, 0.75F, 0.75F, f6); - GL11.glCallList(starGLCallList); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glRotatef(t * 3, 0F, 0F, 1F); + GL11.glRotatef(t * 2, 0F, 1F, 0F); + GL11.glColor4f(1F, 0.75F, 0.75F, f6); + GL11.glCallList(starGLCallList); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glRotatef(t * 3, 0F, 0F, 1F); GL11.glColor4f(1F, 1F, 1F, 0.25F * f6); GL11.glCallList(starGLCallList); GL11.glPopMatrix(); - + GL11.glPushMatrix(); - GL11.glRotatef(t, 0F, 0F, 1F); - GL11.glColor4f(0.5F, 1F, 1F, 0.25F * f6); + GL11.glRotatef(t, 0F, 0F, 1F); + GL11.glColor4f(0.5F, 1F, 1F, 0.25F * f6); GL11.glCallList(starGLCallList); GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glRotatef(t * 2, 0F, 0F, 1F); - GL11.glColor4f(1F, 0.75F, 0.75F, 0.25F * f6); - GL11.glCallList(starGLCallList); - GL11.glPopMatrix(); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glPopMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_FOG); - GL11.glPopMatrix(); - GL11.glDepthMask(true); + GL11.glPushMatrix(); + GL11.glRotatef(t * 2, 0F, 0F, 1F); + GL11.glColor4f(1F, 0.75F, 0.75F, 0.25F * f6); + GL11.glCallList(starGLCallList); + GL11.glPopMatrix(); + + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPopMatrix(); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_FOG); + GL11.glPopMatrix(); + GL11.glDepthMask(true); } - + private void drawObject(Tessellator tess, float f10) { - tess.startDrawingQuads(); - tess.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D); - tess.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D); - tess.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D); - tess.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D); - tess.draw(); + tess.startDrawingQuads(); + tess.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D); + tess.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D); + tess.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D); + tess.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D); + tess.draw(); } } diff --git a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java index 6d4429869..240a503bf 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java @@ -62,6 +62,9 @@ public final class ConfigHandler { public static boolean enableSeasonalFeatures = true; public static boolean useShiftForQuickLookup = false; public static boolean enableArmorModels = true; + public static boolean enableFancySkybox = true; + public static boolean enableFancySkyboxInNormalWorlds = false; + public static int manaBarHeight = 29; public static int flightBarHeight = 49; public static int flightBarBreathHeight = 59; @@ -176,6 +179,12 @@ public final class ConfigHandler { desc = "Set this to false to disable custom armor models."; enableArmorModels = loadPropBool("armorModels.enable", desc, enableArmorModels); + desc = "Set this to false to disable the fancy skybox in Garden of Glass."; + enableFancySkybox = loadPropBool("fancySkybox.enable", desc, enableFancySkybox); + + desc = "Set this to true to enable the fancy skybox in non Garden of Glass worlds. (Does not require Garden of Glass loaded to use, needs 'fancySkybox.enable' to be true as well)"; + enableFancySkyboxInNormalWorlds = loadPropBool("fancySkybox.normalWorlds", desc, enableFancySkyboxInNormalWorlds); + desc = "The height of the mana display bar in above the XP bar. You can change this if you have a mod that changes where the XP bar is."; manaBarHeight = loadPropInt("manaBar.height", desc, manaBarHeight);