diff --git a/patches/net/minecraft/src/Config.java.patch b/patches/net/minecraft/src/Config.java.patch index db0e2071..807fc7eb 100644 --- a/patches/net/minecraft/src/Config.java.patch +++ b/patches/net/minecraft/src/Config.java.patch @@ -1,25 +1,5 @@ --- a/net/minecraft/src/Config.java +++ b/net/minecraft/src/Config.java -@@ -36,8 +36,8 @@ - public static final String OF_NAME = "OptiFine"; - public static final String MC_VERSION = "1.6.4"; - public static final String OF_EDITION = "HD_U"; -- public static final String OF_RELEASE = "C6"; -- public static final String VERSION = "OptiFine_1.6.4_HD_U_C6"; -+ public static final String OF_RELEASE = "D1"; -+ public static final String VERSION = "OptiFine_1.6.4_HD_U_D1"; - private static String newRelease = null; - private static GameSettings gameSettings = null; - private static Minecraft minecraft = null; -@@ -67,7 +67,7 @@ - - public static String getVersion() - { -- return "OptiFine_1.6.4_HD_U_C6"; -+ return "OptiFine_1.6.4_HD_U_D1"; - } - - public static void initGameSettings(GameSettings settings) @@ -1433,27 +1433,7 @@ } diff --git a/patches/net/minecraft/src/CustomColorizer.java.patch b/patches/net/minecraft/src/CustomColorizer.java.patch index 7035b5bb..ca1c67cd 100644 --- a/patches/net/minecraft/src/CustomColorizer.java.patch +++ b/patches/net/minecraft/src/CustomColorizer.java.patch @@ -1,48 +1,8 @@ --- a/net/minecraft/src/CustomColorizer.java +++ b/net/minecraft/src/CustomColorizer.java -@@ -1053,4 +1053,45 @@ - } - } +@@ -1093,4 +1093,5 @@ + + return skyVec; } -+ -+ public static Vec3 getWorldFogColor(Vec3 fogVec, WorldClient world, float partialTicks) -+ { -+ int worldType = world.provider.dimensionId; -+ -+ switch (worldType) -+ { -+ case -1: -+ fogVec = getFogColorNether(fogVec); -+ break; -+ -+ case 0: -+ Minecraft mc = Minecraft.getMinecraft(); -+ fogVec = getFogColor(fogVec, mc.theWorld, mc.renderViewEntity.posX, mc.renderViewEntity.posY + 1.0D, mc.renderViewEntity.posZ); -+ break; -+ -+ case 1: -+ fogVec = getFogColorEnd(fogVec); -+ } -+ -+ return fogVec; -+ } -+ -+ public static Vec3 getWorldSkyColor(Vec3 skyVec, WorldClient world, EntityLivingBase renderViewEntity, float partialTicks) -+ { -+ int worldType = world.provider.dimensionId; -+ -+ switch (worldType) -+ { -+ case 0: -+ Minecraft mc = Minecraft.getMinecraft(); -+ skyVec = getSkyColor(skyVec, mc.theWorld, mc.renderViewEntity.posX, mc.renderViewEntity.posY + 1.0D, mc.renderViewEntity.posZ); -+ break; -+ -+ case 1: -+ skyVec = getSkyColorEnd(skyVec); -+ } -+ -+ return skyVec; -+ } + } diff --git a/patches/net/minecraft/src/EntityRenderer.java.patch b/patches/net/minecraft/src/EntityRenderer.java.patch index 510b9640..f83506c6 100644 --- a/patches/net/minecraft/src/EntityRenderer.java.patch +++ b/patches/net/minecraft/src/EntityRenderer.java.patch @@ -182,8 +182,7 @@ + getPointedEntity(var6, var7, var2, var4); + } + } - -- for (int var13 = 0; var13 < var10.size(); ++var13) ++ + protected void getPointedEntity( Vec3 var6, Vec3 var7, double var2, double var4 ) + { + Vec3 var8 = var6.addVector(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2); @@ -192,7 +191,8 @@ + float var9 = 1.0F; + List var10 = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(this.mc.renderViewEntity, this.mc.renderViewEntity.boundingBox.addCoord(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2).expand((double)var9, (double)var9, (double)var9)); + double var11 = var4; -+ + +- for (int var13 = 0; var13 < var10.size(); ++var13) + for (int var13 = 0; var13 < var10.size(); ++var13) + { + Entity var14 = (Entity)var10.get(var13); @@ -325,7 +325,7 @@ + { + var8 = -1; + } - ++ + if (this.mc.gameSettings.smoothCamera) + { + this.smoothCamYaw += var6; @@ -343,23 +343,34 @@ + } + + this.mc.mcProfiler.endSection(); -+ + + } + /** * Will update any inputs that effect the camera angle (mouse) and then render the world and GUI */ -@@ -986,6 +1038,9 @@ +@@ -986,34 +1038,57 @@ if (!this.initialized) { TextureUtils.registerResourceListener(); +- ItemRendererOF var2 = new ItemRendererOF(this.mc); +- this.itemRenderer = var2; +- RenderManager.instance.itemRenderer = var2; + ItemRendererOF itemRendererOF = new ItemRendererOF(this.mc); + this.itemRenderer = itemRendererOF; + RenderManager.instance.itemRenderer = itemRendererOF; this.initialized = true; } -@@ -999,6 +1054,29 @@ + Config.checkDisplayMode(); +- WorldClient var14 = this.mc.theWorld; ++ WorldClient var2 = this.mc.theWorld; + +- if (var14 != null && Config.getNewRelease() != null) ++ if (var2 != null && Config.getNewRelease() != null) + { + String var3 = "HD_U " + Config.getNewRelease(); + this.mc.ingameGUI.getChatGUI().printChatMessage("A new \u00a7eOptiFine\u00a7f version is available: \u00a7e" + var3 + "\u00a7f"); Config.setNewRelease((String)null); } @@ -389,14 +400,41 @@ if (this.mc.currentScreen instanceof GuiMainMenu) { this.updateMainMenu((GuiMainMenu)this.mc.currentScreen); -@@ -1036,124 +1114,98 @@ + } + +- if (this.updatedWorld != var14) ++ if (this.updatedWorld != var2) + { +- RandomMobs.worldChanged(this.updatedWorld, var14); ++ RandomMobs.worldChanged(this.updatedWorld, var2); + Config.updateThreadPriorities(); + this.lastServerTime = 0L; + this.lastServerTicks = 0; +- this.updatedWorld = var14; ++ this.updatedWorld = var2; + } + + RenderBlocks.fancyGrass = Config.isGrassFancy() || Config.isBetterGrassFancy(); +@@ -1025,9 +1100,9 @@ + } + + this.mc.mcProfiler.endSection(); +- boolean var15 = Display.isActive(); ++ boolean var14 = Display.isActive(); + +- if (!var15 && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) ++ if (!var14 && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) + { + if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) + { +@@ -1039,124 +1114,98 @@ this.prevFrameTime = Minecraft.getSystemTime(); } - this.mc.mcProfiler.startSection("mouse"); + updateCamera( par1, var14 ); -- if (this.mc.inGameHasFocus && var14) +- if (this.mc.inGameHasFocus && var15) + if (!this.mc.skipRenderWorld) { - this.mc.mouseHelper.mouseXYChange(); @@ -435,12 +473,12 @@ + if (this.mc.gameSettings.showDebugInfo != this.lastShowDebugInfo) { - anaglyphEnable = this.mc.gameSettings.anaglyph; -- ScaledResolution var15 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); -- int var16 = var15.getScaledWidth(); -- int var17 = var15.getScaledHeight(); -- int var18 = Mouse.getX() * var16 / this.mc.displayWidth; -- int var20 = var17 - Mouse.getY() * var17 / this.mc.displayHeight - 1; -- int var19 = performanceToFps(this.mc.gameSettings.limitFramerate); +- ScaledResolution var16 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); +- int var17 = var16.getScaledWidth(); +- int var18 = var16.getScaledHeight(); +- int var19 = Mouse.getX() * var17 / this.mc.displayWidth; +- int var21 = var18 - Mouse.getY() * var18 / this.mc.displayHeight - 1; +- int var20 = performanceToFps(this.mc.gameSettings.limitFramerate); + this.showExtendedDebugInfo = this.mc.gameSettings.showDebugProfilerChart; + this.lastShowDebugInfo = this.mc.gameSettings.showDebugInfo; + } @@ -459,7 +497,7 @@ - } - else - { -- this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var19)); +- this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var20)); - } + if (this.mc.gameSettings.ofProfiler) + { @@ -481,7 +519,7 @@ - if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) - { -- this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var18, var20); +- this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var19, var21); - } + if (this.mc.theWorld != null) + { @@ -512,15 +550,15 @@ - try - { -- this.mc.currentScreen.drawScreen(var18, var20, par1); +- this.mc.currentScreen.drawScreen(var19, var21, par1); - } - catch (Throwable var13) - { - CrashReport var11 = CrashReport.makeCrashReport(var13, "Rendering screen"); - CrashReportCategory var12 = var11.makeCategory("Screen render details"); - var12.addCrashSectionCallable("Screen name", new CallableScreenName(this)); -- var12.addCrashSectionCallable("Mouse location", new CallableMouseLocation(this, var18, var20)); -- var12.addCrashSectionCallable("Screen size", new CallableScreenSize(this, var15)); +- var12.addCrashSectionCallable("Mouse location", new CallableMouseLocation(this, var19, var21)); +- var12.addCrashSectionCallable("Screen size", new CallableScreenSize(this, var16)); - throw new ReportedException(var11); - } + if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) @@ -528,9 +566,9 @@ + this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var18, var20); } - } - -- this.waitForServerThread(); - +- this.waitForServerThread(); + - if (this.mc.gameSettings.showDebugInfo != this.lastShowDebugInfo) - { - this.showExtendedDebugInfo = this.mc.gameSettings.showDebugProfilerChart; @@ -579,32 +617,7 @@ { this.serverWaitTimeCurrent = 0; -@@ -1252,10 +1304,12 @@ - this.prevFrameTimeNano = timeNowNano; - GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); - GL11.glMatrixMode(GL11.GL_PROJECTION); -+ GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_COLOR_MATERIAL); - GL11.glLoadIdentity(); - GL11.glOrtho(0.0D, (double)this.mc.displayWidth, (double)this.mc.displayHeight, 0.0D, 1000.0D, 3000.0D); - GL11.glMatrixMode(GL11.GL_MODELVIEW); -+ GL11.glPushMatrix(); - GL11.glLoadIdentity(); - GL11.glTranslatef(0.0F, 0.0F, -2000.0F); - GL11.glLineWidth(1.0F); -@@ -1294,6 +1348,11 @@ - } - - tessellator.draw(); -+ GL11.glMatrixMode(GL11.GL_PROJECTION); -+ GL11.glPopMatrix(); -+ GL11.glMatrixMode(GL11.GL_MODELVIEW); -+ GL11.glPopMatrix(); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); - } - } - -@@ -1614,7 +1673,7 @@ +@@ -1624,7 +1673,7 @@ /** * Render clouds if enabled */ @@ -613,7 +626,7 @@ { if (this.mc.gameSettings.shouldRenderClouds()) { -@@ -1918,211 +1977,186 @@ +@@ -1928,7 +1977,7 @@ /** * calculates fog and calls glClearColor */ @@ -622,306 +635,7 @@ { WorldClient var2 = this.mc.theWorld; EntityLivingBase var3 = this.mc.renderViewEntity; - float var4 = 1.0F / (float)(4 - this.mc.gameSettings.renderDistance); - var4 = 1.0F - (float)Math.pow((double)var4, 0.25D); - Vec3 var5 = var2.getSkyColor(this.mc.renderViewEntity, par1); -- int var6 = var2.provider.dimensionId; -- -- switch (var6) -- { -- case 0: -- var5 = CustomColorizer.getSkyColor(var5, this.mc.theWorld, this.mc.renderViewEntity.posX, this.mc.renderViewEntity.posY + 1.0D, this.mc.renderViewEntity.posZ); -- break; -- -- case 1: -- var5 = CustomColorizer.getSkyColorEnd(var5); -- } -- -- float var7 = (float)var5.xCoord; -- float var8 = (float)var5.yCoord; -- float var9 = (float)var5.zCoord; -- Vec3 var10 = var2.getFogColor(par1); -- -- switch (var6) -- { -- case -1: -- var10 = CustomColorizer.getFogColorNether(var10); -- break; -- -- case 0: -- var10 = CustomColorizer.getFogColor(var10, this.mc.theWorld, this.mc.renderViewEntity.posX, this.mc.renderViewEntity.posY + 1.0D, this.mc.renderViewEntity.posZ); -- break; -- -- case 1: -- var10 = CustomColorizer.getFogColorEnd(var10); -- } -- -- this.fogColorRed = (float)var10.xCoord; -- this.fogColorGreen = (float)var10.yCoord; -- this.fogColorBlue = (float)var10.zCoord; -- float var11; -+ var5 = CustomColorizer.getWorldSkyColor(var5, var2, this.mc.renderViewEntity, par1); -+ float var6 = (float)var5.xCoord; -+ float var7 = (float)var5.yCoord; -+ float var8 = (float)var5.zCoord; -+ Vec3 var9 = var2.getFogColor(par1); -+ var9 = CustomColorizer.getWorldFogColor(var9, var2, par1); -+ this.fogColorRed = (float)var9.xCoord; -+ this.fogColorGreen = (float)var9.yCoord; -+ this.fogColorBlue = (float)var9.zCoord; -+ float var10; - - if (this.mc.gameSettings.renderDistance < 2) - { -- Vec3 var12 = MathHelper.sin(var2.getCelestialAngleRadians(par1)) > 0.0F ? var2.getWorldVec3Pool().getVecFromPool(-1.0D, 0.0D, 0.0D) : var2.getWorldVec3Pool().getVecFromPool(1.0D, 0.0D, 0.0D); -- var11 = (float)var3.getLook(par1).dotProduct(var12); -+ Vec3 var11 = MathHelper.sin(var2.getCelestialAngleRadians(par1)) > 0.0F ? var2.getWorldVec3Pool().getVecFromPool(-1.0D, 0.0D, 0.0D) : var2.getWorldVec3Pool().getVecFromPool(1.0D, 0.0D, 0.0D); -+ var10 = (float)var3.getLook(par1).dotProduct(var11); - -- if (var11 < 0.0F) -+ if (var10 < 0.0F) - { -- var11 = 0.0F; -+ var10 = 0.0F; - } - -- if (var11 > 0.0F) -+ if (var10 > 0.0F) - { -- float[] var13 = var2.provider.calcSunriseSunsetColors(var2.getCelestialAngle(par1), par1); -+ float[] var12 = var2.provider.calcSunriseSunsetColors(var2.getCelestialAngle(par1), par1); - -- if (var13 != null) -+ if (var12 != null) - { -- var11 *= var13[3]; -- this.fogColorRed = this.fogColorRed * (1.0F - var11) + var13[0] * var11; -- this.fogColorGreen = this.fogColorGreen * (1.0F - var11) + var13[1] * var11; -- this.fogColorBlue = this.fogColorBlue * (1.0F - var11) + var13[2] * var11; -+ var10 *= var12[3]; -+ this.fogColorRed = this.fogColorRed * (1.0F - var10) + var12[0] * var10; -+ this.fogColorGreen = this.fogColorGreen * (1.0F - var10) + var12[1] * var10; -+ this.fogColorBlue = this.fogColorBlue * (1.0F - var10) + var12[2] * var10; - } - } - } - -- this.fogColorRed += (var7 - this.fogColorRed) * var4; -- this.fogColorGreen += (var8 - this.fogColorGreen) * var4; -- this.fogColorBlue += (var9 - this.fogColorBlue) * var4; -- float var23 = var2.getRainStrength(par1); -- float var24; -+ this.fogColorRed += (var6 - this.fogColorRed) * var4; -+ this.fogColorGreen += (var7 - this.fogColorGreen) * var4; -+ this.fogColorBlue += (var8 - this.fogColorBlue) * var4; -+ float var22 = var2.getRainStrength(par1); -+ float var23; - -- if (var23 > 0.0F) -+ if (var22 > 0.0F) - { -- var11 = 1.0F - var23 * 0.5F; -- var24 = 1.0F - var23 * 0.4F; -- this.fogColorRed *= var11; -- this.fogColorGreen *= var11; -- this.fogColorBlue *= var24; -+ var10 = 1.0F - var22 * 0.5F; -+ var23 = 1.0F - var22 * 0.4F; -+ this.fogColorRed *= var10; -+ this.fogColorGreen *= var10; -+ this.fogColorBlue *= var23; - } - -- var11 = var2.getWeightedThunderStrength(par1); -+ var10 = var2.getWeightedThunderStrength(par1); - -- if (var11 > 0.0F) -+ if (var10 > 0.0F) - { -- var24 = 1.0F - var11 * 0.5F; -- this.fogColorRed *= var24; -- this.fogColorGreen *= var24; -- this.fogColorBlue *= var24; -+ var23 = 1.0F - var10 * 0.5F; -+ this.fogColorRed *= var23; -+ this.fogColorGreen *= var23; -+ this.fogColorBlue *= var23; - } - -- int var14 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par1); -- float var15; -- Vec3 var16; -+ int var13 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par1); -+ float var14; -+ Vec3 var15; - - if (this.cloudFog) - { -- var16 = var2.getCloudColour(par1); -- this.fogColorRed = (float)var16.xCoord; -- this.fogColorGreen = (float)var16.yCoord; -- this.fogColorBlue = (float)var16.zCoord; -+ var15 = var2.getCloudColour(par1); -+ this.fogColorRed = (float)var15.xCoord; -+ this.fogColorGreen = (float)var15.yCoord; -+ this.fogColorBlue = (float)var15.zCoord; - } -- else if (var14 != 0 && Block.blocksList[var14].blockMaterial == Material.water) -+ else if (var13 != 0 && Block.blocksList[var13].blockMaterial == Material.water) - { -- var15 = (float)EnchantmentHelper.getRespiration(var3) * 0.2F; -- this.fogColorRed = 0.02F + var15; -- this.fogColorGreen = 0.02F + var15; -- this.fogColorBlue = 0.2F + var15; -- var16 = CustomColorizer.getUnderwaterColor(this.mc.theWorld, this.mc.renderViewEntity.posX, this.mc.renderViewEntity.posY + 1.0D, this.mc.renderViewEntity.posZ); -+ var14 = (float)EnchantmentHelper.getRespiration(var3) * 0.2F; -+ this.fogColorRed = 0.02F + var14; -+ this.fogColorGreen = 0.02F + var14; -+ this.fogColorBlue = 0.2F + var14; -+ var15 = CustomColorizer.getUnderwaterColor(this.mc.theWorld, this.mc.renderViewEntity.posX, this.mc.renderViewEntity.posY + 1.0D, this.mc.renderViewEntity.posZ); - -- if (var16 != null) -+ if (var15 != null) - { -- this.fogColorRed = (float)var16.xCoord; -- this.fogColorGreen = (float)var16.yCoord; -- this.fogColorBlue = (float)var16.zCoord; -+ this.fogColorRed = (float)var15.xCoord; -+ this.fogColorGreen = (float)var15.yCoord; -+ this.fogColorBlue = (float)var15.zCoord; - } - } -- else if (var14 != 0 && Block.blocksList[var14].blockMaterial == Material.lava) -+ else if (var13 != 0 && Block.blocksList[var13].blockMaterial == Material.lava) - { - this.fogColorRed = 0.6F; - this.fogColorGreen = 0.1F; - this.fogColorBlue = 0.0F; - } - -- var15 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * par1; -- this.fogColorRed *= var15; -- this.fogColorGreen *= var15; -- this.fogColorBlue *= var15; -- double var25 = var2.provider.getVoidFogYFactor(); -+ var14 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * par1; -+ this.fogColorRed *= var14; -+ this.fogColorGreen *= var14; -+ this.fogColorBlue *= var14; -+ double var24 = var2.provider.getVoidFogYFactor(); - - if (!Config.isDepthFog()) - { -- var25 = 1.0D; -+ var24 = 1.0D; - } - -- double var18 = (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par1) * var25; -+ double var17 = (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par1) * var24; - - if (var3.isPotionActive(Potion.blindness)) - { -- int var20 = var3.getActivePotionEffect(Potion.blindness).getDuration(); -+ int var19 = var3.getActivePotionEffect(Potion.blindness).getDuration(); - -- if (var20 < 20) -+ if (var19 < 20) - { -- var18 *= (double)(1.0F - (float)var20 / 20.0F); -+ var17 *= (double)(1.0F - (float)var19 / 20.0F); - } - else - { -- var18 = 0.0D; -+ var17 = 0.0D; - } - } - -- if (var18 < 1.0D) -+ if (var17 < 1.0D) - { -- if (var18 < 0.0D) -+ if (var17 < 0.0D) - { -- var18 = 0.0D; -+ var17 = 0.0D; - } - -- var18 *= var18; -- this.fogColorRed = (float)((double)this.fogColorRed * var18); -- this.fogColorGreen = (float)((double)this.fogColorGreen * var18); -- this.fogColorBlue = (float)((double)this.fogColorBlue * var18); -+ var17 *= var17; -+ this.fogColorRed = (float)((double)this.fogColorRed * var17); -+ this.fogColorGreen = (float)((double)this.fogColorGreen * var17); -+ this.fogColorBlue = (float)((double)this.fogColorBlue * var17); - } - -- float var26; -+ float var25; - - if (this.field_82831_U > 0.0F) - { -- var26 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * par1; -- this.fogColorRed = this.fogColorRed * (1.0F - var26) + this.fogColorRed * 0.7F * var26; -- this.fogColorGreen = this.fogColorGreen * (1.0F - var26) + this.fogColorGreen * 0.6F * var26; -- this.fogColorBlue = this.fogColorBlue * (1.0F - var26) + this.fogColorBlue * 0.6F * var26; -+ var25 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * par1; -+ this.fogColorRed = this.fogColorRed * (1.0F - var25) + this.fogColorRed * 0.7F * var25; -+ this.fogColorGreen = this.fogColorGreen * (1.0F - var25) + this.fogColorGreen * 0.6F * var25; -+ this.fogColorBlue = this.fogColorBlue * (1.0F - var25) + this.fogColorBlue * 0.6F * var25; - } - -- float var21; -+ float var20; - - if (var3.isPotionActive(Potion.nightVision)) - { -- var26 = this.getNightVisionBrightness(this.mc.thePlayer, par1); -- var21 = 1.0F / this.fogColorRed; -+ var25 = this.getNightVisionBrightness(this.mc.thePlayer, par1); -+ var20 = 1.0F / this.fogColorRed; - -- if (var21 > 1.0F / this.fogColorGreen) -+ if (var20 > 1.0F / this.fogColorGreen) - { -- var21 = 1.0F / this.fogColorGreen; -+ var20 = 1.0F / this.fogColorGreen; - } - -- if (var21 > 1.0F / this.fogColorBlue) -+ if (var20 > 1.0F / this.fogColorBlue) - { -- var21 = 1.0F / this.fogColorBlue; -+ var20 = 1.0F / this.fogColorBlue; - } - -- this.fogColorRed = this.fogColorRed * (1.0F - var26) + this.fogColorRed * var21 * var26; -- this.fogColorGreen = this.fogColorGreen * (1.0F - var26) + this.fogColorGreen * var21 * var26; -- this.fogColorBlue = this.fogColorBlue * (1.0F - var26) + this.fogColorBlue * var21 * var26; -+ this.fogColorRed = this.fogColorRed * (1.0F - var25) + this.fogColorRed * var20 * var25; -+ this.fogColorGreen = this.fogColorGreen * (1.0F - var25) + this.fogColorGreen * var20 * var25; -+ this.fogColorBlue = this.fogColorBlue * (1.0F - var25) + this.fogColorBlue * var20 * var25; - } - - if (this.mc.gameSettings.anaglyph) - { -- var26 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F; -- var21 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F; -- float var22 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F; -- this.fogColorRed = var26; -- this.fogColorGreen = var21; -- this.fogColorBlue = var22; -+ var25 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F; -+ var20 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F; -+ float var21 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F; -+ this.fogColorRed = var25; -+ this.fogColorGreen = var20; -+ this.fogColorBlue = var21; - } - - GL11.glClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); -@@ -2132,7 +2166,7 @@ +@@ -2117,7 +2166,7 @@ * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane * distance and is used for sky rendering. */ @@ -930,7 +644,7 @@ { EntityLivingBase var3 = this.mc.renderViewEntity; boolean var4 = false; -@@ -2310,25 +2344,14 @@ +@@ -2295,25 +2344,14 @@ { Minecraft var1 = Config.getMinecraft(); @@ -949,12 +663,12 @@ - else - { - int var2 = Config.getGameSettings().ofLimitFramerateFine; -- + - if (var2 <= 0) - { - var2 = 10000; - } - +- - return var2; - } + return var2; diff --git a/patches/net/minecraft/src/EnumOptions.java.patch b/patches/net/minecraft/src/EnumOptions.java.patch index dab5cc46..22253a8f 100644 --- a/patches/net/minecraft/src/EnumOptions.java.patch +++ b/patches/net/minecraft/src/EnumOptions.java.patch @@ -9,12 +9,11 @@ AF_LEVEL("Anisotropic Filtering", false, false), RENDER_DISTANCE_FINE("Render Distance", true, false), ANIMATED_TEXTURES("Textures Animated", false, false), -@@ -97,7 +97,92 @@ - HELD_ITEM_TOOLTIPS("Held Item Tooltips", false, false), +@@ -98,7 +98,91 @@ DROPPED_ITEMS("Dropped Items", false, false), LAZY_CHUNK_LOADING("Lazy Chunk Loading", false, false), -- CUSTOM_SKY("Custom Sky", false, false); -+ CUSTOM_SKY("Custom Sky", false, false), + CUSTOM_SKY("Custom Sky", false, false), +- FAST_MATH("Fast Math", false, false); + FAST_MATH("Fast Math", false, false), + // Minecrift below here + diff --git a/patches/net/minecraft/src/GameSettings.java.patch b/patches/net/minecraft/src/GameSettings.java.patch index 6089b53d..60b69b3f 100644 --- a/patches/net/minecraft/src/GameSettings.java.patch +++ b/patches/net/minecraft/src/GameSettings.java.patch @@ -1,14 +1,6 @@ --- a/net/minecraft/src/GameSettings.java +++ b/net/minecraft/src/GameSettings.java -@@ -89,6 +89,7 @@ - public boolean ofShowCapes = true; - public int ofConnectedTextures = 2; - public boolean ofNaturalTextures = false; -+ public boolean ofFastMath = false; - public int ofAnimatedWater = 0; - public int ofAnimatedLava = 0; - public boolean ofAnimatedFire = true; -@@ -216,6 +217,10 @@ +@@ -217,6 +217,10 @@ this.mc = par1Minecraft; this.optionsFile = new File(par2File, "options.txt"); this.optionsFileOF = new File(par2File, "optionsof.txt"); @@ -19,7 +11,7 @@ this.loadOptions(); Config.initGameSettings(this); } -@@ -230,6 +235,28 @@ +@@ -231,6 +235,28 @@ this.noclipRate = 1.0F; this.debugCamRate = 1.0F; this.language = "en_US"; @@ -48,60 +40,7 @@ } public String getKeyBindingDescription(int par1) -@@ -1047,6 +1074,12 @@ - this.mc.renderGlobal.loadRenderers(); - } - -+ if (par1EnumOptions == EnumOptions.FAST_MATH) -+ { -+ this.ofFastMath = !this.ofFastMath; -+ MathHelper.fastMath = this.ofFastMath; -+ } -+ - if (par1EnumOptions == EnumOptions.LAZY_CHUNK_LOADING) - { - this.ofLazyChunkLoading = !this.ofLazyChunkLoading; -@@ -1640,6 +1673,10 @@ - { - return this.ofNaturalTextures ? var3 + "ON" : var3 + "OFF"; - } -+ else if (par1EnumOptions == EnumOptions.FAST_MATH) -+ { -+ return this.ofFastMath ? var3 + "ON" : var3 + "OFF"; -+ } - else if (par1EnumOptions == EnumOptions.LAZY_CHUNK_LOADING) - { - return this.ofLazyChunkLoading ? var3 + "ON" : var3 + "OFF"; -@@ -2375,6 +2412,12 @@ - { - this.ofFullscreenMode = var12[1]; - } -+ -+ if (var12[0].equals("ofFastMath") && var12.length >= 2) -+ { -+ this.ofFastMath = Boolean.valueOf(var12[1]).booleanValue(); -+ MathHelper.fastMath = this.ofFastMath; -+ } - } - catch (Exception var5) - { -@@ -2543,6 +2586,7 @@ - var5.println("ofNaturalTextures:" + this.ofNaturalTextures); - var5.println("ofLazyChunkLoading:" + this.ofLazyChunkLoading); - var5.println("ofFullscreenMode:" + this.ofFullscreenMode); -+ var5.println("ofFastMath:" + this.ofFastMath); - var5.close(); - } - catch (Exception var3) -@@ -2594,6 +2638,7 @@ - this.ofSmoothFps = false; - this.ofSmoothWorld = Config.isSingleProcessor(); - this.ofLazyChunkLoading = Config.isSingleProcessor(); -+ this.ofFastMath = false; - this.ofAoLevel = 1.0F; - this.ofAaLevel = 0; - this.ofAfLevel = 1; -@@ -2649,6 +2694,9 @@ +@@ -2668,6 +2694,9 @@ this.updateWaterOpacity(); this.mc.renderGlobal.setAllRenderersVisible(); this.mc.refreshResources(); diff --git a/patches/net/minecraft/src/GuiPerformanceSettingsOF.java.patch b/patches/net/minecraft/src/GuiPerformanceSettingsOF.java.patch index 2369bc7b..09002f7c 100644 --- a/patches/net/minecraft/src/GuiPerformanceSettingsOF.java.patch +++ b/patches/net/minecraft/src/GuiPerformanceSettingsOF.java.patch @@ -1,14 +1,5 @@ --- a/net/minecraft/src/GuiPerformanceSettingsOF.java +++ b/net/minecraft/src/GuiPerformanceSettingsOF.java -@@ -5,7 +5,7 @@ - private GuiScreen prevScreen; - protected String title = "Performance Settings"; - private GameSettings settings; -- private static EnumOptions[] enumOptions = new EnumOptions[] {EnumOptions.SMOOTH_FPS, EnumOptions.SMOOTH_WORLD, EnumOptions.LOAD_FAR, EnumOptions.PRELOADED_CHUNKS, EnumOptions.CHUNK_UPDATES, EnumOptions.CHUNK_UPDATES_DYNAMIC, EnumOptions.LAZY_CHUNK_LOADING}; -+ private static EnumOptions[] enumOptions = new EnumOptions[] {EnumOptions.SMOOTH_FPS, EnumOptions.SMOOTH_WORLD, EnumOptions.LOAD_FAR, EnumOptions.PRELOADED_CHUNKS, EnumOptions.CHUNK_UPDATES, EnumOptions.CHUNK_UPDATES_DYNAMIC, EnumOptions.FAST_MATH, EnumOptions.LAZY_CHUNK_LOADING}; - private int lastMouseX = 0; - private int lastMouseY = 0; - private long mouseStillTime = 0L; @@ -133,7 +133,7 @@ private String[] getTooltipLines(String btnName) diff --git a/patches/net/minecraft/src/ImageBufferDownload.java.patch b/patches/net/minecraft/src/ImageBufferDownload.java.patch deleted file mode 100644 index 295d9999..00000000 --- a/patches/net/minecraft/src/ImageBufferDownload.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- a/net/minecraft/src/ImageBufferDownload.java -+++ b/net/minecraft/src/ImageBufferDownload.java -@@ -21,23 +21,29 @@ - { - this.imageWidth = 64; - this.imageHeight = 32; -+ int var3 = par1BufferedImage.getWidth(); -+ int var4 = par1BufferedImage.getHeight(); - -- for (BufferedImage var2 = par1BufferedImage; this.imageWidth < var2.getWidth() || this.imageHeight < var2.getHeight(); this.imageHeight *= 2) -+ if (var3 != 64 || var4 != 32 && var4 != 64) - { -- this.imageWidth *= 2; -+ while (this.imageWidth < var3 || this.imageHeight < var4) -+ { -+ this.imageWidth *= 2; -+ this.imageHeight *= 2; -+ } - } - -- BufferedImage var3 = new BufferedImage(this.imageWidth, this.imageHeight, 2); -- Graphics var4 = var3.getGraphics(); -- var4.drawImage(par1BufferedImage, 0, 0, (ImageObserver)null); -- var4.dispose(); -- this.imageData = ((DataBufferInt)var3.getRaster().getDataBuffer()).getData(); -- int var5 = this.imageWidth; -- int var6 = this.imageHeight; -- this.setAreaOpaque(0, 0, var5 / 2, var6 / 2); -- this.setAreaTransparent(var5 / 2, 0, var5, var6); -- this.setAreaOpaque(0, var6 / 2, var5, var6); -- return var3; -+ BufferedImage var5 = new BufferedImage(this.imageWidth, this.imageHeight, 2); -+ Graphics var6 = var5.getGraphics(); -+ var6.drawImage(par1BufferedImage, 0, 0, (ImageObserver)null); -+ var6.dispose(); -+ this.imageData = ((DataBufferInt)var5.getRaster().getDataBuffer()).getData(); -+ int var7 = this.imageWidth; -+ int var8 = this.imageHeight; -+ this.setAreaOpaque(0, 0, var7 / 2, var8 / 2); -+ this.setAreaTransparent(var7 / 2, 0, var7, var8); -+ this.setAreaOpaque(0, var8 / 2, var7, var8); -+ return var5; - } - } - diff --git a/patches/net/minecraft/src/MathHelper.java.patch b/patches/net/minecraft/src/MathHelper.java.patch deleted file mode 100644 index 03dac63c..00000000 --- a/patches/net/minecraft/src/MathHelper.java.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- a/net/minecraft/src/MathHelper.java -+++ b/net/minecraft/src/MathHelper.java -@@ -4,6 +4,20 @@ - - public class MathHelper - { -+ private static final int SIN_BITS = 12; -+ private static final int SIN_MASK = 4095; -+ private static final int SIN_COUNT = 4096; -+ public static final float PI = (float)Math.PI; -+ public static final float PI2 = ((float)Math.PI * 2F); -+ public static final float PId2 = ((float)Math.PI / 2F); -+ private static final float radFull = ((float)Math.PI * 2F); -+ private static final float degFull = 360.0F; -+ private static final float radToIndex = 651.8986F; -+ private static final float degToIndex = 11.377778F; -+ public static final float deg2Rad = 0.017453292F; -+ private static final float[] SIN_TABLE_FAST = new float[4096]; -+ public static boolean fastMath = false; -+ - /** - * A table of sin values computed from 0 (inclusive) to 2*pi (exclusive), with steps of 2*PI / 65536. - */ -@@ -14,7 +28,7 @@ - */ - public static final float sin(float par0) - { -- return SIN_TABLE[(int)(par0 * 10430.378F) & 65535]; -+ return fastMath ? SIN_TABLE_FAST[(int)(par0 * 651.8986F) & 4095] : SIN_TABLE[(int)(par0 * 10430.378F) & 65535]; - } - - /** -@@ -22,7 +36,7 @@ - */ - public static final float cos(float par0) - { -- return SIN_TABLE[(int)(par0 * 10430.378F + 16384.0F) & 65535]; -+ return fastMath ? SIN_TABLE_FAST[(int)((par0 + ((float)Math.PI / 2F)) * 651.8986F) & 4095] : SIN_TABLE[(int)(par0 * 10430.378F + 16384.0F) & 65535]; - } - - public static final float sqrt_float(float par0) -@@ -297,9 +311,21 @@ - - static - { -- for (int var0 = 0; var0 < 65536; ++var0) -+ int i; -+ -+ for (i = 0; i < 65536; ++i) -+ { -+ SIN_TABLE[i] = (float)Math.sin((double)i * Math.PI * 2.0D / 65536.0D); -+ } -+ -+ for (i = 0; i < 4096; ++i) -+ { -+ SIN_TABLE_FAST[i] = (float)Math.sin((double)(((float)i + 0.5F) / 4096.0F * ((float)Math.PI * 2F))); -+ } -+ -+ for (i = 0; i < 360; i += 90) - { -- SIN_TABLE[var0] = (float)Math.sin((double)var0 * Math.PI * 2.0D / 65536.0D); -+ SIN_TABLE_FAST[(int)((float)i * 11.377778F) & 4095] = (float)Math.sin((double)((float)i * 0.017453292F)); - } - } - } diff --git a/patches/net/minecraft/src/Reflector.java.patch b/patches/net/minecraft/src/Reflector.java.patch index ac8d1e11..be8052a2 100644 --- a/patches/net/minecraft/src/Reflector.java.patch +++ b/patches/net/minecraft/src/Reflector.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/src/Reflector.java +++ b/net/minecraft/src/Reflector.java -@@ -33,23 +33,46 @@ +@@ -33,6 +33,9 @@ public static ReflectorMethod ForgeHooks_onLivingDrops = new ReflectorMethod(ForgeHooks, "onLivingDrops"); public static ReflectorMethod ForgeHooks_onLivingFall = new ReflectorMethod(ForgeHooks, "onLivingFall"); public static ReflectorMethod ForgeHooks_onLivingJump = new ReflectorMethod(ForgeHooks, "onLivingJump"); @@ -9,11 +9,9 @@ + public static ReflectorMethod ForgeHooks_onPickBlock = new ReflectorMethod(ForgeHooks, "onPickBlock"); public static ReflectorClass MinecraftForgeClient = new ReflectorClass("net.minecraftforge.client.MinecraftForgeClient"); public static ReflectorMethod MinecraftForgeClient_getRenderPass = new ReflectorMethod(MinecraftForgeClient, "getRenderPass"); -+ public static ReflectorMethod MinecraftForgeClient_getItemRenderer = new ReflectorMethod(MinecraftForgeClient, "getItemRenderer"); - public static ReflectorClass ForgeHooksClient = new ReflectorClass("net.minecraftforge.client.ForgeHooksClient"); - public static ReflectorMethod ForgeHooksClient_onDrawBlockHighlight = new ReflectorMethod(ForgeHooksClient, "onDrawBlockHighlight"); - public static ReflectorMethod ForgeHooksClient_orientBedCamera = new ReflectorMethod(ForgeHooksClient, "orientBedCamera"); -+ public static ReflectorMethod ForgeHooksClient_renderEquippedItem = new ReflectorMethod(ForgeHooksClient, "renderEquippedItem"); + public static ReflectorMethod MinecraftForgeClient_getItemRenderer = new ReflectorMethod(MinecraftForgeClient, "getItemRenderer"); +@@ -42,18 +45,34 @@ + public static ReflectorMethod ForgeHooksClient_renderEquippedItem = new ReflectorMethod(ForgeHooksClient, "renderEquippedItem"); public static ReflectorMethod ForgeHooksClient_dispatchRenderLast = new ReflectorMethod(ForgeHooksClient, "dispatchRenderLast"); public static ReflectorMethod ForgeHooksClient_onTextureLoadPre = new ReflectorMethod(ForgeHooksClient, "onTextureLoadPre"); + public static ReflectorMethod ForgeHooksClient_onTextureLoad = new ReflectorMethod(ForgeHooksClient, "onTextureLoad"); @@ -33,8 +31,8 @@ public static ReflectorClass FMLClientHandler = new ReflectorClass("cpw.mods.fml.client.FMLClientHandler"); public static ReflectorMethod FMLClientHandler_instance = new ReflectorMethod(FMLClientHandler, "instance"); public static ReflectorMethod FMLClientHandler_isLoading = new ReflectorMethod(FMLClientHandler, "isLoading"); -+ public static ReflectorClass ItemRenderType = new ReflectorClass("net.minecraftforge.client.IItemRenderer$ItemRenderType"); -+ public static ReflectorField ItemRenderType_EQUIPPED = new ReflectorField(ItemRenderType, "EQUIPPED"); + public static ReflectorClass ItemRenderType = new ReflectorClass("net.minecraftforge.client.IItemRenderer$ItemRenderType"); + public static ReflectorField ItemRenderType_EQUIPPED = new ReflectorField(ItemRenderType, "EQUIPPED"); + public static ReflectorMethod FMLClientHandler_beginMinecraftLoading = new ReflectorMethod(FMLClientHandler, "beginMinecraftLoading"); + public static ReflectorMethod FMLClientHandler_beginMinecraftLoading2 = new ReflectorMethod(FMLClientHandler, "beginMinecraftLoading"); + public static ReflectorMethod FMLClientHandler_finishMinecraftLoading = new ReflectorMethod(FMLClientHandler, "finishMinecraftLoading"); @@ -47,7 +45,7 @@ public static ReflectorClass ForgeWorldProvider = new ReflectorClass(WorldProvider.class); public static ReflectorMethod ForgeWorldProvider_getSkyRenderer = new ReflectorMethod(ForgeWorldProvider, "getSkyRenderer"); public static ReflectorMethod ForgeWorldProvider_getCloudRenderer = new ReflectorMethod(ForgeWorldProvider, "getCloudRenderer"); -@@ -58,7 +81,9 @@ +@@ -62,7 +81,9 @@ public static ReflectorClass DimensionManager = new ReflectorClass("net.minecraftforge.common.DimensionManager"); public static ReflectorMethod DimensionManager_getStaticDimensionIDs = new ReflectorMethod(DimensionManager, "getStaticDimensionIDs"); public static ReflectorClass WorldEvent_Load = new ReflectorClass("net.minecraftforge.event.world.WorldEvent$Load"); @@ -57,7 +55,7 @@ public static ReflectorClass EventBus = new ReflectorClass("net.minecraftforge.event.EventBus"); public static ReflectorMethod EventBus_post = new ReflectorMethod(EventBus, "post"); public static ReflectorClass ChunkWatchEvent_UnWatch = new ReflectorClass("net.minecraftforge.event.world.ChunkWatchEvent$UnWatch"); -@@ -75,8 +100,16 @@ +@@ -79,10 +100,16 @@ public static ReflectorMethod ForgeTileEntity_shouldRenderInPass = new ReflectorMethod(ForgeTileEntity, "shouldRenderInPass"); public static ReflectorClass ForgeItem = new ReflectorClass(Item.class); public static ReflectorMethod ForgeItem_onEntitySwing = new ReflectorMethod(ForgeItem, "onEntitySwing"); @@ -65,8 +63,8 @@ + public static ReflectorMethod ForgeItem_getRenderPasses = new ReflectorMethod(ForgeItem, "getRenderPasses"); public static ReflectorClass ForgePotionEffect = new ReflectorClass(PotionEffect.class); public static ReflectorMethod ForgePotionEffect_isCurativeItem = new ReflectorMethod(ForgePotionEffect, "isCurativeItem"); -+ public static ReflectorClass ForgeItemStack = new ReflectorClass(ItemStack.class); -+ public static ReflectorMethod ForgeItemStack_hasEffect = new ReflectorMethod(ForgeItemStack, "hasEffect", new Class[] {Integer.TYPE}); + public static ReflectorClass ForgeItemStack = new ReflectorClass(ItemStack.class); + public static ReflectorMethod ForgeItemStack_hasEffect = new ReflectorMethod(ForgeItemStack, "hasEffect", new Class[] {Integer.TYPE}); + public static ReflectorClass ForgeGuiIngame = new ReflectorClass("net.minecraftforge.client.GuiIngameForge"); + public static ReflectorConstructor ForgeGuiIngame_Constructor = new ReflectorConstructor(ForgeGuiIngame, new Class[]{Minecraft.class}); + public static ReflectorField ForgeGuiIngame_renderCrosshairs = new ReflectorField(ForgeGuiIngame, "renderCrosshairs"); @@ -74,33 +72,3 @@ public static void callVoid(ReflectorMethod refMethod, Object ... params) { -@@ -542,4 +575,29 @@ - return classes; - } - } -+ -+ public static Field getFieldByType(Class cls, Class fieldType) -+ { -+ try -+ { -+ Field[] e = cls.getDeclaredFields(); -+ -+ for (int i = 0; i < e.length; ++i) -+ { -+ Field field = e[i]; -+ -+ if (field.getType() == fieldType) -+ { -+ field.setAccessible(true); -+ return field; -+ } -+ } -+ -+ return null; -+ } -+ catch (Exception var5) -+ { -+ return null; -+ } -+ } - } diff --git a/patches/net/minecraft/src/ThreadDownloadImage.java.patch b/patches/net/minecraft/src/ThreadDownloadImage.java.patch deleted file mode 100644 index 6db26d54..00000000 --- a/patches/net/minecraft/src/ThreadDownloadImage.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/net/minecraft/src/ThreadDownloadImage.java -+++ b/net/minecraft/src/ThreadDownloadImage.java -@@ -30,23 +30,24 @@ - conn.setDoOutput(false); - conn.connect(); - -- if (conn.getResponseCode() / 100 == 2) -+ if (conn.getResponseCode() / 100 != 2) - { -- BufferedImage var2 = ImageIO.read(conn.getInputStream()); -+ return; -+ } - -- if (this.imageBuffer != null) -- { -- var2 = this.imageBuffer.parseUserSkin(var2); -- } -+ BufferedImage var2 = ImageIO.read(conn.getInputStream()); - -- this.parent.getBufferedImage(var2); -- return; -+ if (this.imageBuffer != null) -+ { -+ var2 = this.imageBuffer.parseUserSkin(var2); - } -+ -+ this.parent.getBufferedImage(var2); -+ return; - } - catch (Exception var7) - { - System.out.println(var7.getClass().getName() + ": " + var7.getMessage()); -- return; - } - finally - { diff --git a/patches/net/minecraft/src/VersionCheckThread.java.patch b/patches/net/minecraft/src/VersionCheckThread.java.patch index 396fbda2..b9b7c5e0 100644 --- a/patches/net/minecraft/src/VersionCheckThread.java.patch +++ b/patches/net/minecraft/src/VersionCheckThread.java.patch @@ -1,11 +1,26 @@ --- a/net/minecraft/src/VersionCheckThread.java +++ b/net/minecraft/src/VersionCheckThread.java -@@ -34,7 +34,7 @@ - String newVer = verLines[0]; - Config.dbg("Version found: " + newVer); +@@ -26,16 +26,16 @@ + in.close(); + String[] verLines = Config.tokenize(verStr, "\n\r"); -- if (Config.compareRelease(newVer, "C6") > 0) -+ if (Config.compareRelease(newVer, "D1") > 0) +- if (verLines.length >= 1) ++ if (verLines.length < 1) { +- String newVer = verLines[0]; +- Config.dbg("Version found: " + newVer); ++ return; ++ } + +- if (Config.compareRelease(newVer, "D1") <= 0) +- { +- return; +- } ++ String newVer = verLines[0]; ++ Config.dbg("Version found: " + newVer); + ++ if (Config.compareRelease(newVer, "D1") > 0) ++ { Config.setNewRelease(newVer); return; + } diff --git a/src/net/minecraft/src/ItemRendererOF.java b/src/net/minecraft/src/ItemRendererOF.java deleted file mode 100644 index 66940ec4..00000000 --- a/src/net/minecraft/src/ItemRendererOF.java +++ /dev/null @@ -1,144 +0,0 @@ -package net.minecraft.src; - -import java.lang.reflect.Field; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -public class ItemRendererOF extends ItemRenderer -{ - /** A reference to the Minecraft object. */ - private Minecraft mc = null; - - /** Instance of RenderBlocks. */ - private RenderBlocks renderBlocksInstance = null; - private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); - private static Field ItemRenderer_renderBlockInstance = Reflector.getFieldByType(ItemRenderer.class, RenderBlocks.class); - - public ItemRendererOF(Minecraft par1Minecraft) - { - super(par1Minecraft); - this.mc = par1Minecraft; - - if (ItemRenderer_renderBlockInstance == null) - { - Config.error("ItemRenderOF not initialized"); - } - - try - { - this.renderBlocksInstance = (RenderBlocks)ItemRenderer_renderBlockInstance.get(this); - } - catch (IllegalAccessException var3) - { - throw new RuntimeException(var3); - } - } - - /** - * Renders the item stack for being in an entity's hand Args: itemStack - */ - public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3) - { - GL11.glPushMatrix(); - TextureManager var4 = this.mc.getTextureManager(); - boolean hasForge = Reflector.MinecraftForgeClient.exists(); - Block block = null; - - if (par2ItemStack.getItem() instanceof ItemBlock && par2ItemStack.itemID < Block.blocksList.length) - { - block = Block.blocksList[par2ItemStack.itemID]; - } - - Object type = null; - Object customRenderer = null; - - if (hasForge) - { - type = Reflector.getFieldValue(Reflector.ItemRenderType_EQUIPPED); - customRenderer = Reflector.call(Reflector.MinecraftForgeClient_getItemRenderer, new Object[] {par2ItemStack, type}); - } - - if (customRenderer != null) - { - var4.bindTexture(var4.getResourceLocation(par2ItemStack.getItemSpriteNumber())); - Reflector.callVoid(Reflector.ForgeHooksClient_renderEquippedItem, new Object[] {type, customRenderer, this.renderBlocksInstance, par1EntityLivingBase, par2ItemStack}); - } - else if (block != null && par2ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(block.getRenderType())) - { - var4.bindTexture(var4.getResourceLocation(0)); - this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); - } - else - { - Icon var5 = par1EntityLivingBase.getItemIcon(par2ItemStack, par3); - - if (var5 == null) - { - GL11.glPopMatrix(); - return; - } - - var4.bindTexture(var4.getResourceLocation(par2ItemStack.getItemSpriteNumber())); - Tessellator var6 = Tessellator.instance; - float var7 = var5.getMinU(); - float var8 = var5.getMaxU(); - float var9 = var5.getMinV(); - float var10 = var5.getMaxV(); - float var11 = 0.0F; - float var12 = 0.3F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glTranslatef(-var11, -var12, 0.0F); - float var13 = 1.5F; - GL11.glScalef(var13, var13, var13); - GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); - renderItemIn2D(var6, var8, var9, var7, var10, var5.getIconWidth(), var5.getIconHeight(), 0.0625F); - boolean renderEffect = false; - - if (Reflector.ForgeItemStack_hasEffect.exists()) - { - renderEffect = Reflector.callBoolean(par2ItemStack, Reflector.ForgeItemStack_hasEffect, new Object[] {Integer.valueOf(par3)}); - } - else - { - renderEffect = par2ItemStack.hasEffect() && par3 == 0; - } - - if (renderEffect) - { - GL11.glDepthFunc(GL11.GL_EQUAL); - GL11.glDisable(GL11.GL_LIGHTING); - var4.bindTexture(RES_ITEM_GLINT); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); - float var14 = 0.76F; - GL11.glColor4f(0.5F * var14, 0.25F * var14, 0.8F * var14, 1.0F); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glPushMatrix(); - float var15 = 0.125F; - GL11.glScalef(var15, var15, var15); - float var16 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; - GL11.glTranslatef(var16, 0.0F, 0.0F); - GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); - renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 16, 16, 0.0625F); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(var15, var15, var15); - var16 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; - GL11.glTranslatef(-var16, 0.0F, 0.0F); - GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); - renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 16, 16, 0.0625F); - GL11.glPopMatrix(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_LEQUAL); - } - - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - } - - GL11.glPopMatrix(); - } -}