From 77d6ae8ffa719e1e026b8ce5d4685ed13598aca3 Mon Sep 17 00:00:00 2001 From: Christian Weeks Date: Wed, 16 May 2012 00:01:12 -0400 Subject: [PATCH] Update patches: add in a setup for most of the texturefx classes --- .../net/minecraft/client/Minecraft.java.patch | 10 ++-- .../net/minecraft/src/RenderEngine.java.patch | 11 +++-- .../minecraft/src/TextureCompassFX.java.patch | 9 ++-- .../net/minecraft/src/TextureFX.java.patch | 16 +++++-- .../minecraft/src/TextureFlamesFX.java.patch | 27 ++++++----- .../minecraft/src/TextureLavaFX.java.patch | 46 +++++++++++++------ .../src/TextureLavaFlowFX.java.patch | 37 ++++++++------- .../minecraft/src/TexturePortalFX.java.patch | 7 +-- .../minecraft/src/TextureWatchFX.java.patch | 9 ++-- .../minecraft/src/TextureWaterFX.java.patch | 27 +++++++---- .../src/TextureWaterFlowFX.java.patch | 35 ++++++++------ 11 files changed, 143 insertions(+), 91 deletions(-) diff --git a/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 3fe5835cd..0073ae4ee 100644 --- a/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -17,15 +17,17 @@ this.field_40007_r = new FontRenderer(this.field_6304_y, "/font/alternate.png", this.field_6315_n, false); if (this.field_6304_y.field_44018_Q != null) -@@ -330,6 +333,7 @@ +@@ -330,6 +333,9 @@ GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glMatrixMode(GL11.GL_MODELVIEW); + FMLClientHandler.instance().onLoadComplete(); ++ this.field_9231_Y.setup(); ++ this.field_9232_X.setup(); this.func_6250_c("Startup"); this.field_6286_O = new OpenGlCapsChecker(); this.field_6301_A.func_340_a(this.field_6304_y); -@@ -744,9 +748,11 @@ +@@ -744,9 +750,11 @@ this.field_6327_b.func_6467_a(this.field_9237_P.field_1378_c); } @@ -37,7 +39,7 @@ } GL11.glFlush(); -@@ -1340,6 +1346,7 @@ +@@ -1340,6 +1348,7 @@ this.func_28001_B(); } @@ -45,7 +47,7 @@ Profiler.func_40663_a("stats"); this.field_25001_G.func_27178_d(); Profiler.func_40661_c("gui"); -@@ -1730,6 +1737,7 @@ +@@ -1730,6 +1739,7 @@ } Profiler.func_40662_b(); diff --git a/fml/patches/minecraft/net/minecraft/src/RenderEngine.java.patch b/fml/patches/minecraft/net/minecraft/src/RenderEngine.java.patch index d96357458..dd59ffd4c 100644 --- a/fml/patches/minecraft/net/minecraft/src/RenderEngine.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/RenderEngine.java.patch @@ -85,7 +85,7 @@ var7.printStackTrace(); } } -@@ -616,9 +639,27 @@ +@@ -616,9 +639,28 @@ } catch (IOException var6) { @@ -101,19 +101,20 @@ + + FMLClientHandler.instance().preTexturePackChange(var1, tileSize, tileSizeSquare, tileSizeMask, tileSizeSquareMask); + -+ for (Object tex : field_1604_f) { -+ ((TextureFX)tex).onTexturePackChange(tileSize, tileSizeSquare, tileSizeMask, tileSizeSquareMask); -+ } + TextureFX.iconTileSize = tileSize; + TextureFX.tileSizeSquare = tileSizeSquare; + TextureFX.tileSizeMask = tileSizeMask; + TextureFX.tileSizeSquareMask = tileSizeSquareMask; ++ ++ for (Object tex : field_1604_f) { ++ ((TextureFX)tex).onTexturePackChange(tileSize, tileSizeSquare, tileSizeMask, tileSizeSquareMask); ++ } + + FMLClientHandler.instance().postTexturePackChange(var1); } private BufferedImage func_6526_a(InputStream p_6526_1_) throws IOException -@@ -635,4 +676,8 @@ +@@ -635,4 +677,8 @@ GL11.glBindTexture(GL11.GL_TEXTURE_2D, p_1076_1_); } } diff --git a/fml/patches/minecraft/net/minecraft/src/TextureCompassFX.java.patch b/fml/patches/minecraft/net/minecraft/src/TextureCompassFX.java.patch index fd853ad01..653c59006 100644 --- a/fml/patches/minecraft/net/minecraft/src/TextureCompassFX.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/TextureCompassFX.java.patch @@ -9,7 +9,7 @@ private double field_4229_i; private double field_4228_j; -@@ -17,13 +17,25 @@ +@@ -17,13 +17,26 @@ super(Item.field_4025_aO.func_27009_a(0)); this.field_4231_g = p_i617_1_; this.field_1128_f = 1; @@ -25,6 +25,7 @@ + public void setup() + { ++ super.setup(); + field_4230_h = new int[tileSizeSquare]; try { @@ -39,7 +40,7 @@ } catch (IOException var5) { -@@ -33,7 +45,7 @@ +@@ -33,7 +46,7 @@ public void func_783_a() { @@ -48,7 +49,7 @@ { int var2 = this.field_4230_h[var1] >> 24 & 255; int var3 = this.field_4230_h[var1] >> 16 & 255; -@@ -110,11 +122,11 @@ +@@ -110,11 +123,11 @@ int var19; int var18; @@ -64,7 +65,7 @@ var13 = 100; var14 = 100; var15 = 100; -@@ -136,11 +148,11 @@ +@@ -136,11 +149,11 @@ this.field_1127_a[var12 * 4 + 3] = (byte)var16; } diff --git a/fml/patches/minecraft/net/minecraft/src/TextureFX.java.patch b/fml/patches/minecraft/net/minecraft/src/TextureFX.java.patch index d9a502705..c1411d455 100644 --- a/fml/patches/minecraft/net/minecraft/src/TextureFX.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/TextureFX.java.patch @@ -1,6 +1,13 @@ --- ../src-base/minecraft/net/minecraft/src/TextureFX.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src-work/minecraft/net/minecraft/src/TextureFX.java 0000-00-00 00:00:00.000000000 -0000 -@@ -10,6 +10,11 @@ +@@ -4,12 +4,17 @@ + + public class TextureFX + { +- public byte[] field_1127_a = new byte[1024]; ++ public byte[] field_1127_a = new byte[tileSizeSquare << 2]; + public int field_1126_b; + public boolean field_1131_c = false; public int field_1130_d = 0; public int field_1129_e = 1; public int field_1128_f = 0; @@ -12,14 +19,17 @@ public TextureFX(int p_i616_1_) { -@@ -29,4 +34,19 @@ +@@ -29,4 +34,22 @@ GL11.glBindTexture(GL11.GL_TEXTURE_2D, p_782_1_.func_1070_a("/gui/items.png")); } } + + public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask) { + errored = false; -+ field_1127_a = new byte[newTileSizeSquare << 2]; ++ setup(); ++ } ++ public void setup() { ++ field_1127_a = new byte[tileSizeSquare << 2]; + } + + /** diff --git a/fml/patches/minecraft/net/minecraft/src/TextureFlamesFX.java.patch b/fml/patches/minecraft/net/minecraft/src/TextureFlamesFX.java.patch index f17e89ef0..ecaf09252 100644 --- a/fml/patches/minecraft/net/minecraft/src/TextureFlamesFX.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/TextureFlamesFX.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/src/TextureFlamesFX.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src-work/minecraft/net/minecraft/src/TextureFlamesFX.java 0000-00-00 00:00:00.000000000 -0000 -@@ -4,43 +4,62 @@ +@@ -4,10 +4,28 @@ { protected float[] field_1133_g = new float[320]; protected float[] field_1132_h = new float[320]; @@ -10,23 +10,26 @@ public TextureFlamesFX(int p_i474_1_) { super(Block.field_402_as.field_378_bb + p_i474_1_ * 16); - } - ++ setup(); ++ } ++ + @Override + public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask) + { + super.onTexturePackChange(newTileSize, newTileSizeSquare, newTileSizeMask, newTileSizeSquareMask); ++ setup(); ++ } ++ public void setup() ++ { ++ super.setup(); + fireTileSize = iconTileSize + (iconTileSize >> 2); + fireGridSize = fireTileSize * iconTileSize; -+ if (field_1132_h.length != fireGridSize) { -+ field_1133_g = new float[fireGridSize]; -+ field_1132_h = new float[fireGridSize]; -+ } -+ } -+ ++ field_1133_g = new float[fireGridSize]; ++ field_1132_h = new float[fireGridSize]; + } + public void func_783_a() - { - int var3; +@@ -16,31 +34,36 @@ float var4; int var6; @@ -72,7 +75,7 @@ } } } -@@ -49,7 +68,7 @@ +@@ -49,7 +72,7 @@ this.field_1132_h = this.field_1133_g; this.field_1133_g = var13; diff --git a/fml/patches/minecraft/net/minecraft/src/TextureLavaFX.java.patch b/fml/patches/minecraft/net/minecraft/src/TextureLavaFX.java.patch index faccd9bed..734d32d55 100644 --- a/fml/patches/minecraft/net/minecraft/src/TextureLavaFX.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/TextureLavaFX.java.patch @@ -1,25 +1,41 @@ --- ../src-base/minecraft/net/minecraft/src/TextureLavaFX.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src-work/minecraft/net/minecraft/src/TextureLavaFX.java 0000-00-00 00:00:00.000000000 -0000 -@@ -12,6 +12,18 @@ - super(Block.field_397_D.field_378_bb); - } +@@ -2,14 +2,30 @@ + public class TextureLavaFX extends TextureFX + { +- protected float[] field_1147_g = new float[256]; +- protected float[] field_1146_h = new float[256]; +- protected float[] field_1145_i = new float[256]; +- protected float[] field_1144_j = new float[256]; ++ protected float[] field_1147_g; ++ protected float[] field_1146_h; ++ protected float[] field_1145_i; ++ protected float[] field_1144_j; + + public TextureLavaFX() + { + super(Block.field_397_D.field_378_bb); ++ setup(); ++ } ++ + @Override + public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask) + { + super.onTexturePackChange(newTileSize, newTileSizeSquare, newTileSizeMask, newTileSizeSquareMask); -+ if (field_1147_g.length != tileSizeSquare) { -+ field_1147_g = new float[tileSizeSquare]; -+ field_1146_h = new float[tileSizeSquare]; -+ field_1145_i = new float[tileSizeSquare]; -+ field_1144_j = new float[tileSizeSquare]; -+ } ++ setup(); + } -+ ++ public void setup() ++ { ++ super.setup(); ++ field_1147_g = new float[tileSizeSquare]; ++ field_1146_h = new float[tileSizeSquare]; ++ field_1145_i = new float[tileSizeSquare]; ++ field_1144_j = new float[tileSizeSquare]; + } + public void func_783_a() - { - int var2; -@@ -22,9 +34,9 @@ +@@ -22,9 +38,9 @@ int var8; int var9; @@ -31,7 +47,7 @@ { var3 = 0.0F; int var4 = (int)(MathHelper.func_1106_a((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F); -@@ -36,23 +48,23 @@ +@@ -36,23 +52,23 @@ { var8 = var6 + var4 & 15; var9 = var7 + var5 & 15; @@ -62,7 +78,7 @@ } } } -@@ -61,7 +73,7 @@ +@@ -61,7 +77,7 @@ this.field_1146_h = this.field_1147_g; this.field_1147_g = var11; diff --git a/fml/patches/minecraft/net/minecraft/src/TextureLavaFlowFX.java.patch b/fml/patches/minecraft/net/minecraft/src/TextureLavaFlowFX.java.patch index 0d0aac0b1..74a02d162 100644 --- a/fml/patches/minecraft/net/minecraft/src/TextureLavaFlowFX.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/TextureLavaFlowFX.java.patch @@ -1,26 +1,31 @@ --- ../src-base/minecraft/net/minecraft/src/TextureLavaFlowFX.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src-work/minecraft/net/minecraft/src/TextureLavaFlowFX.java 0000-00-00 00:00:00.000000000 -0000 -@@ -14,6 +14,19 @@ +@@ -12,6 +12,24 @@ + { + super(Block.field_397_D.field_378_bb + 1); this.field_1129_e = 2; - } - ++ setup(); ++ } ++ + @Override + public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask) + { + super.onTexturePackChange(newTileSize, newTileSizeSquare, newTileSizeMask, newTileSizeSquareMask); -+ if (field_1140_j.length!=tileSizeSquare) { -+ field_1143_g = new float[tileSizeSquare]; -+ field_1142_h = new float[tileSizeSquare]; -+ field_1141_i = new float[tileSizeSquare]; -+ field_1140_j = new float[tileSizeSquare]; -+ } -+ field_1139_k = 0; ++ setup(); + } -+ ++ ++ public void setup() ++ { ++ super.setup(); ++ field_1143_g = new float[tileSizeSquare]; ++ field_1142_h = new float[tileSizeSquare]; ++ field_1141_i = new float[tileSizeSquare]; ++ field_1140_j = new float[tileSizeSquare]; ++ field_1139_k = 0; + } + public void func_783_a() - { - ++this.field_1139_k; -@@ -25,9 +38,9 @@ +@@ -25,9 +43,9 @@ int var8; int var9; @@ -32,7 +37,7 @@ { var3 = 0.0F; int var4 = (int)(MathHelper.func_1106_a((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F); -@@ -37,25 +50,25 @@ +@@ -37,25 +55,25 @@ { for (var7 = var2 - 1; var7 <= var2 + 1; ++var7) { @@ -67,7 +72,7 @@ } } } -@@ -64,9 +77,9 @@ +@@ -64,9 +82,9 @@ this.field_1142_h = this.field_1143_g; this.field_1143_g = var11; diff --git a/fml/patches/minecraft/net/minecraft/src/TexturePortalFX.java.patch b/fml/patches/minecraft/net/minecraft/src/TexturePortalFX.java.patch index 9124ed9dd..72aedf6f9 100644 --- a/fml/patches/minecraft/net/minecraft/src/TexturePortalFX.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/TexturePortalFX.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/src/TexturePortalFX.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src-work/minecraft/net/minecraft/src/TexturePortalFX.java 0000-00-00 00:00:00.000000000 -0000 -@@ -5,28 +5,34 @@ +@@ -5,28 +5,35 @@ public class TexturePortalFX extends TextureFX { private int field_4227_g = 0; @@ -15,6 +15,7 @@ + + private void setupPortalTextures() + { ++ super.setup(); + field_4226_h = new byte[32][tileSizeSquare << 4]; Random var1 = new Random(100L); @@ -42,7 +43,7 @@ if (var9 < -1.0F) { -@@ -60,7 +66,7 @@ +@@ -60,7 +67,7 @@ int var13 = (int)(var5 * var5 * 200.0F + 55.0F); int var14 = (int)(var5 * var5 * var5 * var5 * 255.0F); int var15 = (int)(var5 * 100.0F + 155.0F); @@ -51,7 +52,7 @@ this.field_4226_h[var2][var16 * 4 + 0] = (byte)var13; this.field_4226_h[var2][var16 * 4 + 1] = (byte)var14; this.field_4226_h[var2][var16 * 4 + 2] = (byte)var6; -@@ -68,14 +74,24 @@ +@@ -68,14 +75,24 @@ } } } diff --git a/fml/patches/minecraft/net/minecraft/src/TextureWatchFX.java.patch b/fml/patches/minecraft/net/minecraft/src/TextureWatchFX.java.patch index 79db09118..b4af6981c 100644 --- a/fml/patches/minecraft/net/minecraft/src/TextureWatchFX.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/TextureWatchFX.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/src/TextureWatchFX.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src-work/minecraft/net/minecraft/src/TextureWatchFX.java 0000-00-00 00:00:00.000000000 -0000 -@@ -18,15 +18,21 @@ +@@ -18,15 +18,22 @@ super(Item.field_4023_aQ.func_27009_a(0)); this.field_4225_g = p_i364_1_; this.field_1128_f = 1; @@ -10,6 +10,7 @@ + + public void setup() + { ++ super.setup(); + field_4224_h = new int[tileSizeSquare]; + field_4223_i = new int[tileSizeSquare]; try @@ -29,7 +30,7 @@ } catch (IOException var5) { -@@ -34,6 +40,15 @@ +@@ -34,6 +41,15 @@ } } @@ -45,7 +46,7 @@ public void func_783_a() { double var1 = 0.0D; -@@ -77,7 +92,7 @@ +@@ -77,7 +93,7 @@ double var5 = Math.sin(this.field_4222_j); double var7 = Math.cos(this.field_4222_j); @@ -54,7 +55,7 @@ { int var10 = this.field_4224_h[var9] >> 24 & 255; int var11 = this.field_4224_h[var9] >> 16 & 255; -@@ -86,12 +101,12 @@ +@@ -86,12 +102,12 @@ if (var11 == var13 && var12 == 0 && var13 > 0) { diff --git a/fml/patches/minecraft/net/minecraft/src/TextureWaterFX.java.patch b/fml/patches/minecraft/net/minecraft/src/TextureWaterFX.java.patch index fa2d7e325..50873d375 100644 --- a/fml/patches/minecraft/net/minecraft/src/TextureWaterFX.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/TextureWaterFX.java.patch @@ -1,26 +1,33 @@ --- ../src-base/minecraft/net/minecraft/src/TextureWaterFX.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src-work/minecraft/net/minecraft/src/TextureWaterFX.java 0000-00-00 00:00:00.000000000 -0000 -@@ -13,6 +13,19 @@ +@@ -11,8 +11,26 @@ + public TextureWaterFX() + { super(Block.field_401_B.field_378_bb); ++ setup(); } + @Override + public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask) + { + super.onTexturePackChange(newTileSize, newTileSizeSquare, newTileSizeMask, newTileSizeSquareMask); -+ if (field_1158_g.length!=tileSizeSquare) { -+ field_1158_g = new float[tileSizeSquare]; -+ field_1157_h = new float[tileSizeSquare]; -+ field_1156_i = new float[tileSizeSquare]; -+ field_1155_j = new float[tileSizeSquare]; -+ } ++ setup(); ++ } ++ ++ public void setup() ++ { ++ super.setup(); ++ field_1158_g = new float[tileSizeSquare]; ++ field_1157_h = new float[tileSizeSquare]; ++ field_1156_i = new float[tileSizeSquare]; ++ field_1155_j = new float[tileSizeSquare]; + field_1154_k = 0; + } + public void func_783_a() { ++this.field_1154_k; -@@ -22,9 +35,9 @@ +@@ -22,9 +40,9 @@ int var5; int var6; @@ -32,7 +39,7 @@ { var3 = 0.0F; -@@ -32,29 +45,29 @@ +@@ -32,29 +50,29 @@ { var5 = var4 & 15; var6 = var2 & 15; @@ -71,7 +78,7 @@ } } } -@@ -63,7 +76,7 @@ +@@ -63,7 +81,7 @@ this.field_1157_h = this.field_1158_g; this.field_1158_g = var12; diff --git a/fml/patches/minecraft/net/minecraft/src/TextureWaterFlowFX.java.patch b/fml/patches/minecraft/net/minecraft/src/TextureWaterFlowFX.java.patch index 5c93d589a..ea94fd9b4 100644 --- a/fml/patches/minecraft/net/minecraft/src/TextureWaterFlowFX.java.patch +++ b/fml/patches/minecraft/net/minecraft/src/TextureWaterFlowFX.java.patch @@ -1,26 +1,31 @@ --- ../src-base/minecraft/net/minecraft/src/TextureWaterFlowFX.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src-work/minecraft/net/minecraft/src/TextureWaterFlowFX.java 0000-00-00 00:00:00.000000000 -0000 -@@ -14,6 +14,19 @@ +@@ -12,6 +12,24 @@ + { + super(Block.field_401_B.field_378_bb + 1); this.field_1129_e = 2; - } - ++ setup(); ++ } ++ + @Override + public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask) + { + super.onTexturePackChange(newTileSize, newTileSizeSquare, newTileSizeMask, newTileSizeSquareMask); -+ if (field_1138_g.length!=tileSizeSquare) { -+ field_1138_g = new float[tileSizeSquare]; -+ field_1137_h = new float[tileSizeSquare]; -+ field_1136_i = new float[tileSizeSquare]; -+ field_1135_j = new float[tileSizeSquare]; -+ } -+ field_1134_k = 0; ++ setup(); + } -+ ++ ++ public void setup() ++ { ++ super.setup(); ++ field_1138_g = new float[tileSizeSquare]; ++ field_1137_h = new float[tileSizeSquare]; ++ field_1136_i = new float[tileSizeSquare]; ++ field_1135_j = new float[tileSizeSquare]; ++ field_1134_k = 0; + } + public void func_783_a() - { - ++this.field_1134_k; -@@ -22,40 +35,40 @@ +@@ -22,40 +40,40 @@ float var3; int var5; int var6; @@ -75,7 +80,7 @@ } } } -@@ -64,9 +77,9 @@ +@@ -64,9 +82,9 @@ this.field_1137_h = this.field_1138_g; this.field_1138_g = var12;