Update patches for hd textures

This commit is contained in:
Christian Weeks 2012-05-15 22:10:38 -04:00
parent 0e3dcc4eda
commit 25ced3f321
11 changed files with 319 additions and 238 deletions

View file

@ -9,7 +9,7 @@
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
@@ -13,9 +16,16 @@
@@ -13,9 +16,17 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -21,12 +21,22 @@
+import com.pclewis.mcpatcher.mod.TileSize;
+
+import cpw.mods.fml.client.FMLClientHandler;
+import cpw.mods.fml.common.FMLCommonHandler;
+
public class RenderEngine
{
public static boolean field_1609_a = false;
@@ -97,6 +107,7 @@
@@ -24,7 +35,7 @@
private IntHashMap field_1607_c = new IntHashMap();
private IntBuffer field_1606_d = GLAllocation.func_1125_c(1);
private ByteBuffer field_1605_e = GLAllocation.func_1127_b(16777216);
- private List field_1604_f = new ArrayList();
+ List field_1604_f = new ArrayList();
private Map field_1603_g = new HashMap();
private GameSettings field_1602_h;
public boolean field_4281_i = false;
@@ -97,6 +108,7 @@
}
catch (IOException var5)
{
@ -34,65 +44,40 @@
var5.printStackTrace();
int[] var4 = this.func_28148_b(this.field_25189_l);
this.field_28151_c.put(p_28149_1_, var4);
@@ -452,6 +463,7 @@
p_1066_1_.func_783_a();
}
+ @SuppressWarnings("deprecation")
public void func_1067_a()
{
int var1 = -1;
@@ -459,23 +471,43 @@
@@ -459,8 +471,11 @@
for (int var2 = 0; var2 < this.field_1604_f.size(); ++var2)
{
TextureFX var3 = (TextureFX)this.field_1604_f.get(var2);
+ if (var3.field_1126_b != var1)
+ {
+ var3.func_782_a(this);
+ var1 = var3.field_1126_b;
+ }
+ Profiler.func_40663_a("hdTextureHandling");
+ int tileSize = GL11.glGetTexLevelParameteri(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH ) >>4;
+ var3.textureGridSize = tileSize * tileSize;
+ var3.textureLength = tileSize;
+ TileSize.int_numPixels=var3.textureGridSize;
+ TileSize.int_size=tileSize;
+ TileSize.int_sizeMinus1=tileSize-1;
+ if (var3.field_1127_a==null || var3.field_1127_a.length!= var3.textureGridSize << 2) {
+ var3.field_1127_a = new byte[var3.textureGridSize << 2];
+ }
+ Profiler.func_40662_b();
+ if (var3.errored) continue;
var3.field_1131_c = this.field_1602_h.field_1578_g;
+ Profiler.func_40663_a(var3.getClass().getSimpleName());
var3.func_783_a();
+ Profiler.func_40662_b();
+ if (var3.field_1127_a.length!=var3.textureGridSize<<2) {
+ if (!var3.hasWarned) {
+ FMLCommonHandler.instance().getFMLLogger().warning(String.format("Detected a texture FX discrepancy in %s (%d, %d)",var3.getClass().getSimpleName(), var3.field_1127_a.length, var3.textureGridSize<<2));
+ var3.hasWarned=true;
+ }
+ continue;
+ }
this.field_1605_e.clear();
this.field_1605_e.put(var3.field_1127_a);
this.field_1605_e.position(0).limit(var3.field_1127_a.length);
- if (var3.field_1126_b != var1)
- {
- var3.func_782_a(this);
- var1 = var3.field_1126_b;
- }
@@ -470,12 +485,19 @@
var3.func_782_a(this);
var1 = var3.field_1126_b;
}
+ if (var3.field_1127_a.length!=TextureFX.tileSizeSquare<<2) {
+ if (!var3.errored) {
+ FMLCommonHandler.instance().getFMLLogger().warning(String.format("Detected a texture FX discrepancy in %s (%d, %d)",var3.getClass().getSimpleName(), var3.field_1127_a.length, var3.tileSizeSquare<<2));
+ var3.errored=true;
+ }
+ continue;
+ }
for (int var4 = 0; var4 < var3.field_1129_e; ++var4)
{
for (int var5 = 0; var5 < var3.field_1129_e; ++var5)
{
- GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, var3.field_1126_b % 16 * 16 + var4 * 16, var3.field_1126_b / 16 * 16 + var5 * 16, 16, 16, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, this.field_1605_e);
+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, var3.field_1126_b % 16 * tileSize + var4 * tileSize, var3.field_1126_b / 16 * tileSize + var5 * tileSize, tileSize, tileSize, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, this.field_1605_e);
+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, var3.field_1126_b % 16 * TextureFX.tileSize + var4 * TextureFX.tileSize, var3.field_1126_b / 16 * TextureFX.tileSize + var5 * TextureFX.tileSize, TextureFX.tileSize, TextureFX.tileSize, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, this.field_1605_e);
}
}
}
@@ -579,6 +611,7 @@
@@ -579,6 +601,7 @@
}
catch (IOException var7)
{
@ -100,7 +85,35 @@
var7.printStackTrace();
}
}
@@ -635,4 +668,8 @@
@@ -616,9 +639,27 @@
}
catch (IOException var6)
{
+ FMLCommonHandler.instance().getFMLLogger().log(Level.INFO,String.format("An error occured reading texture file data %s (refreshTexture)", var9),var6);
var6.printStackTrace();
}
}
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, func_1070_a("/terrain.png"));
+ int tileSize = GL11.glGetTexLevelParameteri(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH ) >> 4;
+ int tileSizeSquare = TextureFX.tileSize*TextureFX.tileSize;
+ int tileSizeMask = TextureFX.tileSize - 1;
+ int tileSizeSquareMask = TextureFX.tileSizeSquare - 1;
+
+ FMLClientHandler.instance().preTexturePackChange(var1, tileSize, tileSizeSquare, tileSizeMask, tileSizeSquareMask);
+
+ for (Object tex : field_1604_f) {
+ ((TextureFX)tex).onTexturePackChange(tileSize, tileSizeSquare, tileSizeMask, tileSizeSquareMask);
+ }
+ TextureFX.tileSize = tileSize;
+ TextureFX.tileSizeSquare = tileSizeSquare;
+ TextureFX.tileSizeMask = tileSizeMask;
+ TextureFX.tileSizeSquareMask = tileSizeSquareMask;
+
+ FMLClientHandler.instance().postTexturePackChange(var1);
}
private BufferedImage func_6526_a(InputStream p_6526_1_) throws IOException
@@ -635,4 +676,8 @@
GL11.glBindTexture(GL11.GL_TEXTURE_2D, p_1076_1_);
}
}

View file

@ -9,16 +9,23 @@
private double field_4229_i;
private double field_4228_j;
@@ -17,13 +17,17 @@
@@ -17,13 +17,25 @@
super(Item.field_4025_aO.func_27009_a(0));
this.field_4231_g = p_i617_1_;
this.field_1128_f = 1;
-
+ setup();
+ }
+
+ @Override
+ public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask)
+ {
+ super.onTexturePackChange(newTileSize, newTileSizeSquare, newTileSizeMask, newTileSizeSquareMask);
+ setup();
+ }
+ public void setup()
+ {
+ field_4230_h = new int[textureGridSize];
+ field_4230_h = new int[tileSizeSquare];
try
{
- BufferedImage var2 = ImageIO.read(Minecraft.class.getResource("/gui/items.png"));
@ -26,53 +33,50 @@
- int var4 = this.field_1126_b / 16 * 16;
- var2.getRGB(var3, var4, 16, 16, this.field_4230_h, 0, 16);
+ BufferedImage var2 = ImageIO.read(field_4231_g.field_6298_C.field_6534_a.func_6481_a("/gui/items.png"));
+ int var3 = this.field_1126_b % 16 * textureLength;
+ int var4 = this.field_1126_b / 16 * textureLength;
+ var2.getRGB(var3, var4, textureLength, textureLength, this.field_4230_h, 0, textureLength);
+ int var3 = this.field_1126_b % 16 * tileSize;
+ int var4 = this.field_1126_b / 16 * tileSize;
+ var2.getRGB(var3, var4, tileSize, tileSize, this.field_4230_h, 0, tileSize);
}
catch (IOException var5)
{
@@ -33,7 +37,10 @@
@@ -33,7 +45,7 @@
public void func_783_a()
{
- for (int var1 = 0; var1 < 256; ++var1)
+ if (field_4230_h.length!=textureGridSize) {
+ setup();
+ }
+ for (int var1 = 0; var1 < textureGridSize; ++var1)
+ for (int var1 = 0; var1 < tileSizeSquare; ++var1)
{
int var2 = this.field_4230_h[var1] >> 24 & 255;
int var3 = this.field_4230_h[var1] >> 16 & 255;
@@ -110,11 +117,11 @@
@@ -110,11 +122,11 @@
int var19;
int var18;
- for (var9 = -4; var9 <= 4; ++var9)
+ for (var9 = -(textureLength >> 2); var9 <= (textureLength >> 2); ++var9)
+ for (var9 = -(tileSize >> 2); var9 <= (tileSize >> 2); ++var9)
{
- var10 = (int)(8.5D + var26 * (double)var9 * 0.3D);
- var11 = (int)(7.5D - var24 * (double)var9 * 0.3D * 0.5D);
- var12 = var11 * 16 + var10;
+ var10 = (int)((textureLength >> 1) + 0.5D + var26 * (double)var9 * 0.3D);
+ var11 = (int)((textureLength >> 1) - 0.5D - var24 * (double)var9 * 0.3D * 0.5D);
+ var12 = var11 * textureLength + var10;
+ var10 = (int)((tileSize >> 1) + 0.5D + var26 * (double)var9 * 0.3D);
+ var11 = (int)((tileSize >> 1) - 0.5D - var24 * (double)var9 * 0.3D * 0.5D);
+ var12 = var11 * tileSize + var10;
var13 = 100;
var14 = 100;
var15 = 100;
@@ -136,11 +143,11 @@
@@ -136,11 +148,11 @@
this.field_1127_a[var12 * 4 + 3] = (byte)var16;
}
- for (var9 = -8; var9 <= 16; ++var9)
+ for (var9 = -(textureLength>>2); var9 <= textureLength; ++var9)
+ for (var9 = -(tileSize>>2); var9 <= tileSize; ++var9)
{
- var10 = (int)(8.5D + var24 * (double)var9 * 0.3D);
- var11 = (int)(7.5D + var26 * (double)var9 * 0.3D * 0.5D);
- var12 = var11 * 16 + var10;
+ var10 = (int)((textureLength >> 1) + 0.5D + var24 * (double)var9 * 0.3D);
+ var11 = (int)((textureLength >> 1) - 0.5D + var26 * (double)var9 * 0.3D * 0.5D);
+ var12 = var11 * textureLength + var10;
+ var10 = (int)((tileSize >> 1) + 0.5D + var24 * (double)var9 * 0.3D);
+ var11 = (int)((tileSize >> 1) - 0.5D + var26 * (double)var9 * 0.3D * 0.5D);
+ var12 = var11 * tileSize + var10;
var13 = var9 >= 0 ? 255 : 100;
var14 = var9 >= 0 ? 20 : 100;
var15 = var9 >= 0 ? 20 : 100;

View file

@ -1,12 +1,34 @@
--- ../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,9 @@
@@ -10,6 +10,11 @@
public int field_1130_d = 0;
public int field_1129_e = 1;
public int field_1128_f = 0;
+ public int textureGridSize = 256;
+ public int textureLength = 16;
+ public boolean hasWarned = false;
+ public static int tileSize = 16;
+ public static int tileSizeSquare = 256;
+ public static int tileSizeMask = 15;
+ public static int tileSizeSquareMask = 255;
+ public boolean errored = false;
public TextureFX(int p_i616_1_)
{
@@ -29,4 +34,19 @@
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];
+ }
+
+ /**
+ * @return
+ *
+ */
+ public boolean unregister(RenderEngine engine)
+ {
+ engine.field_1604_f.remove(this);
+ return true;
+ }
}

View file

@ -1,44 +1,60 @@
--- ../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
@@ -12,35 +12,46 @@
@@ -4,43 +4,62 @@
{
protected float[] field_1133_g = new float[320];
protected float[] field_1132_h = new float[320];
+ private int fireTileSize = 20;
+ private int fireGridSize = 320;
public void func_783_a()
public TextureFlamesFX(int p_i474_1_)
{
+ int fireLength = textureLength + (textureLength >> 2);
+ int fireGridSize = fireLength * textureLength;
super(Block.field_402_as.field_378_bb + p_i474_1_ * 16);
}
+ @Override
+ public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask)
+ {
+ super.onTexturePackChange(newTileSize, newTileSizeSquare, newTileSizeMask, newTileSizeSquareMask);
+ fireTileSize = tileSize + (tileSize >> 2);
+ fireGridSize = fireTileSize * tileSize;
+ if (field_1132_h.length != fireGridSize) {
+ field_1133_g = new float[fireGridSize];
+ field_1132_h = new float[fireGridSize];
+ }
+ }
+
public void func_783_a()
{
int var3;
float var4;
int var6;
- for (int var1 = 0; var1 < 16; ++var1)
+ float fireFactor1 = 3.0F + (float)(textureLength >> 4);
+ float fireFactor1 = 3.0F + (float)(tileSize >> 4);
+
+ float fireFactor2 = 1.07F - (textureLength >> 4) *0.01F;
+ float fireFactor2 = 1.07F - (tileSize >> 4) *0.01F;
+
+ for (int var1 = 0; var1 < textureLength; ++var1)
+ for (int var1 = 0; var1 < tileSize; ++var1)
{
- for (int var2 = 0; var2 < 20; ++var2)
+ for (int var2 = 0; var2 < fireLength; ++var2)
+ for (int var2 = 0; var2 < fireTileSize; ++var2)
{
- var3 = 18;
- var4 = this.field_1133_g[var1 + (var2 + 1) % 20 * 16] * (float)var3;
+ var3 = fireLength - 2;//(textureLength >> 3);
+ var3 = fireTileSize - 2;//(tileSize >> 3);
+
+ var4 = this.field_1133_g[var1 + (var2 + 1) % fireLength * textureLength] * (float)var3;
+ var4 = this.field_1133_g[var1 + (var2 + 1) % fireTileSize * tileSize] * (float)var3;
for (int var5 = var1 - 1; var5 <= var1 + 1; ++var5)
{
for (var6 = var2; var6 <= var2 + 1; ++var6)
{
- if (var5 >= 0 && var6 >= 0 && var5 < 16 && var6 < 20)
+ if (var5 >= 0 && var6 >= 0 && var5 < textureLength && var6 < fireLength)
+ if (var5 >= 0 && var6 >= 0 && var5 < tileSize && var6 < fireTileSize)
{
- var4 += this.field_1133_g[var5 + var6 * 16];
+ var4 += this.field_1133_g[var5 + var6 * textureLength];
+ var4 += this.field_1133_g[var5 + var6 * tileSize];
}
++var3;
@ -46,22 +62,22 @@
}
- this.field_1132_h[var1 + var2 * 16] = var4 / ((float)var3 * 1.0600001F);
+ this.field_1132_h[var1 + var2 * textureLength] = var4 / ((float)var3 * fireFactor2);
+ this.field_1132_h[var1 + var2 * tileSize] = var4 / ((float)var3 * fireFactor2);
- if (var2 >= 19)
+ if (var2 >= fireLength - (textureLength >> 4))
+ if (var2 >= fireTileSize - (tileSize >> 4))
{
- this.field_1132_h[var1 + var2 * 16] = (float)(Math.random() * Math.random() * Math.random() * 4.0D + Math.random() * 0.10000000149011612D + 0.20000000298023224D);
+ this.field_1132_h[var1 + var2 * textureLength] = (float)(Math.random() * Math.random() * Math.random() * fireFactor1 + Math.random() * 0.1F + 0.2F);
+ this.field_1132_h[var1 + var2 * tileSize] = (float)(Math.random() * Math.random() * Math.random() * fireFactor1 + Math.random() * 0.1F + 0.2F);
}
}
}
@@ -49,7 +60,7 @@
@@ -49,7 +68,7 @@
this.field_1132_h = this.field_1133_g;
this.field_1133_g = var13;
- for (var3 = 0; var3 < 256; ++var3)
+ for (var3 = 0; var3 < textureGridSize; ++var3)
+ for (var3 = 0; var3 < tileSizeSquare; ++var3)
{
var4 = this.field_1133_g[var3] * 1.8F;

View file

@ -1,67 +1,73 @@
--- ../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
@@ -14,6 +14,12 @@
@@ -12,6 +12,18 @@
super(Block.field_397_D.field_378_bb);
}
+ @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];
+ }
+ }
+
public void func_783_a()
{
+ if (field_1147_g.length != textureGridSize) {
+ field_1147_g = new float[textureGridSize];
+ field_1146_h = new float[textureGridSize];
+ field_1145_i = new float[textureGridSize];
+ field_1144_j = new float[textureGridSize];
+ }
int var2;
float var3;
int var5;
@@ -22,9 +28,9 @@
@@ -22,9 +34,9 @@
int var8;
int var9;
- for (int var1 = 0; var1 < 16; ++var1)
+ for (int var1 = 0; var1 < textureLength; ++var1)
+ for (int var1 = 0; var1 < tileSize; ++var1)
{
- for (var2 = 0; var2 < 16; ++var2)
+ for (var2 = 0; var2 < textureLength; ++var2)
+ for (var2 = 0; var2 < tileSize; ++var2)
{
var3 = 0.0F;
int var4 = (int)(MathHelper.func_1106_a((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
@@ -36,23 +42,23 @@
@@ -36,23 +48,23 @@
{
var8 = var6 + var4 & 15;
var9 = var7 + var5 & 15;
- var3 += this.field_1147_g[var8 + var9 * 16];
+ var3 += this.field_1147_g[var8 + var9 * textureLength];
+ var3 += this.field_1147_g[var8 + var9 * tileSize];
}
}
- this.field_1146_h[var1 + var2 * 16] = var3 / 10.0F + (this.field_1145_i[(var1 + 0 & 15) + (var2 + 0 & 15) * 16] + this.field_1145_i[(var1 + 1 & 15) + (var2 + 0 & 15) * 16] + this.field_1145_i[(var1 + 1 & 15) + (var2 + 1 & 15) * 16] + this.field_1145_i[(var1 + 0 & 15) + (var2 + 1 & 15) * 16]) / 4.0F * 0.8F;
- this.field_1145_i[var1 + var2 * 16] += this.field_1144_j[var1 + var2 * 16] * 0.01F;
+ this.field_1146_h[var1 + var2 * textureLength] = var3 / 10.0F + (this.field_1145_i[(var1 + 0 & 15) + (var2 + 0 & 15) * textureLength] + this.field_1145_i[(var1 + 1 & 15) + (var2 + 0 & 15) * textureLength] + this.field_1145_i[(var1 + 1 & 15) + (var2 + 1 & 15) * textureLength] + this.field_1145_i[(var1 + 0 & 15) + (var2 + 1 & 15) * textureLength]) / 4.0F * 0.8F;
+ this.field_1145_i[var1 + var2 * textureLength] += this.field_1144_j[var1 + var2 * textureLength] * 0.01F;
+ this.field_1146_h[var1 + var2 * tileSize] = var3 / 10.0F + (this.field_1145_i[(var1 + 0 & 15) + (var2 + 0 & 15) * tileSize] + this.field_1145_i[(var1 + 1 & 15) + (var2 + 0 & 15) * tileSize] + this.field_1145_i[(var1 + 1 & 15) + (var2 + 1 & 15) * tileSize] + this.field_1145_i[(var1 + 0 & 15) + (var2 + 1 & 15) * tileSize]) / 4.0F * 0.8F;
+ this.field_1145_i[var1 + var2 * tileSize] += this.field_1144_j[var1 + var2 * tileSize] * 0.01F;
- if (this.field_1145_i[var1 + var2 * 16] < 0.0F)
+ if (this.field_1145_i[var1 + var2 * textureLength] < 0.0F)
+ if (this.field_1145_i[var1 + var2 * tileSize] < 0.0F)
{
- this.field_1145_i[var1 + var2 * 16] = 0.0F;
+ this.field_1145_i[var1 + var2 * textureLength] = 0.0F;
+ this.field_1145_i[var1 + var2 * tileSize] = 0.0F;
}
- this.field_1144_j[var1 + var2 * 16] -= 0.06F;
+ this.field_1144_j[var1 + var2 * textureLength] -= 0.06F;
+ this.field_1144_j[var1 + var2 * tileSize] -= 0.06F;
if (Math.random() < 0.005D)
{
- this.field_1144_j[var1 + var2 * 16] = 1.5F;
+ this.field_1144_j[var1 + var2 * textureLength] = 1.5F;
+ this.field_1144_j[var1 + var2 * tileSize] = 1.5F;
}
}
}
@@ -61,7 +67,7 @@
@@ -61,7 +73,7 @@
this.field_1146_h = this.field_1147_g;
this.field_1147_g = var11;
- for (var2 = 0; var2 < 256; ++var2)
+ for (var2 = 0; var2 < textureGridSize; ++var2)
+ for (var2 = 0; var2 < tileSizeSquare; ++var2)
{
var3 = this.field_1147_g[var2] * 2.0F;

View file

@ -1,77 +1,81 @@
--- ../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
@@ -16,6 +16,12 @@
@@ -14,6 +14,19 @@
this.field_1129_e = 2;
}
+ @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;
+ }
+
public void func_783_a()
{
+ if (field_1140_j.length!=textureGridSize) {
+ field_1143_g = new float[textureGridSize];
+ field_1142_h = new float[textureGridSize];
+ field_1141_i = new float[textureGridSize];
+ field_1140_j = new float[textureGridSize];
+ }
++this.field_1139_k;
int var2;
float var3;
@@ -25,9 +31,12 @@
@@ -25,9 +38,9 @@
int var8;
int var9;
- for (int var1 = 0; var1 < 16; ++var1)
+ int textureLengthMask=textureLength-1;
+ int textureGridSizeMask=textureGridSize-1;
+
+ for (int var1 = 0; var1 < textureLength; ++var1)
+ for (int var1 = 0; var1 < tileSize; ++var1)
{
- for (var2 = 0; var2 < 16; ++var2)
+ for (var2 = 0; var2 < textureLength; ++var2)
+ for (var2 = 0; var2 < tileSize; ++var2)
{
var3 = 0.0F;
int var4 = (int)(MathHelper.func_1106_a((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
@@ -37,25 +46,25 @@
@@ -37,25 +50,25 @@
{
for (var7 = var2 - 1; var7 <= var2 + 1; ++var7)
{
- var8 = var6 + var4 & 15;
- var9 = var7 + var5 & 15;
- var3 += this.field_1143_g[var8 + var9 * 16];
+ var8 = var6 + var4 & textureLengthMask;
+ var9 = var7 + var5 & textureLengthMask;
+ var3 += this.field_1143_g[var8 + var9 * textureLength];
+ var8 = var6 + var4 & tileSizeMask;
+ var9 = var7 + var5 & tileSizeMask;
+ var3 += this.field_1143_g[var8 + var9 * tileSize];
}
}
- this.field_1142_h[var1 + var2 * 16] = var3 / 10.0F + (this.field_1141_i[(var1 + 0 & 15) + (var2 + 0 & 15) * 16] + this.field_1141_i[(var1 + 1 & 15) + (var2 + 0 & 15) * 16] + this.field_1141_i[(var1 + 1 & 15) + (var2 + 1 & 15) * 16] + this.field_1141_i[(var1 + 0 & 15) + (var2 + 1 & 15) * 16]) / 4.0F * 0.8F;
- this.field_1141_i[var1 + var2 * 16] += this.field_1140_j[var1 + var2 * 16] * 0.01F;
+ this.field_1142_h[var1 + var2 * textureLength] = var3 / 10.0F + (this.field_1141_i[(var1 + 0 & textureLengthMask) + (var2 + 0 & textureLengthMask) * textureLength] + this.field_1141_i[(var1 + 1 & textureLengthMask) + (var2 + 0 & textureLengthMask) * textureLength] + this.field_1141_i[(var1 + 1 & textureLengthMask) + (var2 + 1 & textureLengthMask) * textureLength] + this.field_1141_i[(var1 + 0 & textureLengthMask) + (var2 + 1 & textureLengthMask) * textureLength]) / 4.0F * 0.8F;
+ this.field_1141_i[var1 + var2 * textureLength] += this.field_1140_j[var1 + var2 * textureLength] * 0.01F;
+ this.field_1142_h[var1 + var2 * tileSize] = var3 / 10.0F + (this.field_1141_i[(var1 + 0 & tileSizeMask) + (var2 + 0 & tileSizeMask) * tileSize] + this.field_1141_i[(var1 + 1 & tileSizeMask) + (var2 + 0 & tileSizeMask) * tileSize] + this.field_1141_i[(var1 + 1 & tileSizeMask) + (var2 + 1 & tileSizeMask) * tileSize] + this.field_1141_i[(var1 + 0 & tileSizeMask) + (var2 + 1 & tileSizeMask) * tileSize]) / 4.0F * 0.8F;
+ this.field_1141_i[var1 + var2 * tileSize] += this.field_1140_j[var1 + var2 * tileSize] * 0.01F;
- if (this.field_1141_i[var1 + var2 * 16] < 0.0F)
+ if (this.field_1141_i[var1 + var2 * textureLength] < 0.0F)
+ if (this.field_1141_i[var1 + var2 * tileSize] < 0.0F)
{
- this.field_1141_i[var1 + var2 * 16] = 0.0F;
+ this.field_1141_i[var1 + var2 * textureLength] = 0.0F;
+ this.field_1141_i[var1 + var2 * tileSize] = 0.0F;
}
- this.field_1140_j[var1 + var2 * 16] -= 0.06F;
+ this.field_1140_j[var1 + var2 * textureLength] -= 0.06F;
+ this.field_1140_j[var1 + var2 * tileSize] -= 0.06F;
if (Math.random() < 0.005D)
{
- this.field_1140_j[var1 + var2 * 16] = 1.5F;
+ this.field_1140_j[var1 + var2 * textureLength] = 1.5F;
+ this.field_1140_j[var1 + var2 * tileSize] = 1.5F;
}
}
}
@@ -64,9 +73,9 @@
@@ -64,9 +77,9 @@
this.field_1142_h = this.field_1143_g;
this.field_1143_g = var11;
- for (var2 = 0; var2 < 256; ++var2)
+ for (var2 = 0; var2 < textureGridSize; ++var2)
+ for (var2 = 0; var2 < tileSizeSquare; ++var2)
{
- var3 = this.field_1143_g[var2 - this.field_1139_k / 3 * 16 & 255] * 2.0F;
+ var3 = this.field_1143_g[(var2 - this.field_1139_k / 3 * textureLength) & textureGridSizeMask] * 2.0F;
+ var3 = this.field_1143_g[(var2 - this.field_1139_k / 3 * tileSize) & tileSizeSquareMask] * 2.0F;
if (var3 > 1.0F)
{

View file

@ -9,19 +9,11 @@
import net.minecraft.client.Minecraft;
public class TexturePackList
@@ -56,6 +58,7 @@
this.field_6537_e.field_6304_y.field_6524_j = this.field_6535_g;
this.field_6537_e.field_6304_y.func_1041_b();
this.field_6534_a.func_6482_a();
+ FMLClientHandler.instance().onTexturePackChange(p_6531_1_);
return true;
}
}
@@ -140,6 +143,7 @@
@@ -140,6 +142,7 @@
if (this.field_6534_a == null)
{
this.field_6534_a = this.field_6539_c;
+ FMLClientHandler.instance().onTexturePackFallback(this.field_6539_c);
+ FMLClientHandler.instance().onEarlyTexturePackLoad(this.field_6539_c);
}
this.field_6533_b.removeAll(var1);

View file

@ -15,16 +15,16 @@
+
+ private void setupPortalTextures()
+ {
+ field_4226_h = new byte[32][textureGridSize << 4];
+ field_4226_h = new byte[32][tileSizeSquare << 4];
Random var1 = new Random(100L);
for (int var2 = 0; var2 < 32; ++var2)
{
- for (int var3 = 0; var3 < 16; ++var3)
+ for (int var3 = 0; var3 < textureLength; ++var3)
+ for (int var3 = 0; var3 < tileSize; ++var3)
{
- for (int var4 = 0; var4 < 16; ++var4)
+ for (int var4 = 0; var4 < textureLength; ++var4)
+ for (int var4 = 0; var4 < tileSize; ++var4)
{
float var5 = 0.0F;
int var6;
@ -35,10 +35,10 @@
- float var8 = (float)(var6 * 16) * 0.5F;
- float var9 = ((float)var3 - var7) / 16.0F * 2.0F;
- float var10 = ((float)var4 - var8) / 16.0F * 2.0F;
+ float var7 = (float)(var6 * textureLength) * 0.5F;
+ float var8 = (float)(var6 * textureLength) * 0.5F;
+ float var9 = ((float)var3 - var7) / (float)textureLength * 2.0F;
+ float var10 = ((float)var4 - var8) / (float)textureLength * 2.0F;
+ float var7 = (float)(var6 * tileSize) * 0.5F;
+ float var8 = (float)(var6 * tileSize) * 0.5F;
+ float var9 = ((float)var3 - var7) / (float)tileSize * 2.0F;
+ float var10 = ((float)var4 - var8) / (float)tileSize * 2.0F;
if (var9 < -1.0F)
{
@ -47,22 +47,33 @@
int var14 = (int)(var5 * var5 * var5 * var5 * 255.0F);
int var15 = (int)(var5 * 100.0F + 155.0F);
- int var16 = var4 * 16 + var3;
+ int var16 = var4 * textureLength + var3;
+ int var16 = var4 * tileSize + var3;
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;
@@ -72,10 +78,13 @@
@@ -68,14 +74,24 @@
}
}
}
+ field_4227_g = 0;
}
+ /* (non-Javadoc)
+ * @see net.minecraft.src.TextureFX#onTexturePackChange(int, int, int, int)
+ */
+ @Override
+ public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask)
+ {
+ super.onTexturePackChange(newTileSize, newTileSizeSquare, newTileSizeMask, newTileSizeSquareMask);
+ setupPortalTextures();
+ }
public void func_783_a()
{
+ if (field_4226_h[0].length!=textureGridSize << 4) {
+ setupPortalTextures();
+ }
++this.field_4227_g;
byte[] var1 = this.field_4226_h[this.field_4227_g & 31];
- for (int var2 = 0; var2 < 256; ++var2)
+ for (int var2 = 0; var2 < textureGridSize; ++var2)
+ for (int var2 = 0; var2 < tileSizeSquare; ++var2)
{
int var3 = var1[var2 * 4 + 0] & 255;
int var4 = var1[var2 * 4 + 1] & 255;

View file

@ -10,8 +10,8 @@
+
+ public void setup()
+ {
+ field_4224_h = new int[textureGridSize];
+ field_4223_i = new int[textureGridSize];
+ field_4224_h = new int[tileSizeSquare];
+ field_4223_i = new int[tileSizeSquare];
try
{
- BufferedImage var2 = ImageIO.read(Minecraft.class.getResource("/gui/items.png"));
@ -21,55 +21,54 @@
- var2 = ImageIO.read(Minecraft.class.getResource("/misc/dial.png"));
- var2.getRGB(0, 0, 16, 16, this.field_4223_i, 0, 16);
+ BufferedImage var2 = ImageIO.read(field_4225_g.field_6298_C.field_6534_a.func_6481_a("/gui/items.png"));
+ int var3 = this.field_1126_b % 16 * textureLength;
+ int var4 = this.field_1126_b / 16 * textureLength;
+ var2.getRGB(var3, var4, textureLength, textureLength, this.field_4224_h, 0, textureLength);
+ int var3 = this.field_1126_b % 16 * tileSize;
+ int var4 = this.field_1126_b / 16 * tileSize;
+ var2.getRGB(var3, var4, tileSize, tileSize, this.field_4224_h, 0, tileSize);
+ var2 = ImageIO.read(field_4225_g.field_6298_C.field_6534_a.func_6481_a("/misc/dial.png"));
+ var2.getRGB(0, 0, textureLength, textureLength, this.field_4223_i, 0, textureLength);
+ var2.getRGB(0, 0, tileSize, tileSize, this.field_4223_i, 0, tileSize);
}
catch (IOException var5)
{
@@ -36,6 +42,9 @@
@@ -34,6 +40,15 @@
}
}
public void func_783_a()
{
+ if (field_4224_h.length!=textureGridSize) {
+ @Override
+ public void onTexturePackChange(int newTileSize, int newTileSizeSquare, int newTileSizeMask, int newTileSizeSquareMask)
+ {
+ super.onTexturePackChange(newTileSize, newTileSizeSquare, newTileSizeMask, newTileSizeSquareMask);
+ if (field_4224_h.length!=tileSizeSquare) {
+ setup();
+ }
+ }
+
public void func_783_a()
{
double var1 = 0.0D;
if (this.field_4225_g.field_6324_e != null && this.field_4225_g.field_6322_g != null)
@@ -71,13 +80,14 @@
var22 = 1.0D;
}
+ int textureLengthMask = textureLength - 1;
this.field_4221_k += var22 * 0.1D;
this.field_4221_k *= 0.8D;
this.field_4222_j += this.field_4221_k;
@@ -77,7 +92,7 @@
double var5 = Math.sin(this.field_4222_j);
double var7 = Math.cos(this.field_4222_j);
- for (int var9 = 0; var9 < 256; ++var9)
+ for (int var9 = 0; var9 < textureGridSize; ++var9)
+ for (int var9 = 0; var9 < tileSizeSquare; ++var9)
{
int var10 = this.field_4224_h[var9] >> 24 & 255;
int var11 = this.field_4224_h[var9] >> 16 & 255;
@@ -86,12 +96,12 @@
@@ -86,12 +101,12 @@
if (var11 == var13 && var12 == 0 && var13 > 0)
{
- double var14 = -((double)(var9 % 16) / 15.0D - 0.5D);
- double var16 = (double)(var9 / 16) / 15.0D - 0.5D;
+ double var14 = -((double)(var9 % textureLength) / textureLengthMask - 0.5D);
+ double var16 = (double)(var9 / textureLength) / textureLengthMask - 0.5D;
+ double var14 = -((double)(var9 % tileSize) / tileSizeMask - 0.5D);
+ double var16 = (double)(var9 / tileSize) / tileSizeMask - 0.5D;
int var18 = var11;
- int var19 = (int)((var14 * var7 + var16 * var5 + 0.5D) * 16.0D);
- int var20 = (int)((var16 * var7 - var14 * var5 + 0.5D) * 16.0D);
- int var21 = (var19 & 15) + (var20 & 15) * 16;
+ int var19 = (int)((var14 * var7 + var16 * var5 + 0.5D) * textureLength);
+ int var20 = (int)((var16 * var7 - var14 * var5 + 0.5D) * textureLength);
+ int var21 = (var19 & textureLengthMask) + (var20 & textureLengthMask) * textureLength;
+ int var19 = (int)((var14 * var7 + var16 * var5 + 0.5D) * tileSize);
+ int var20 = (int)((var16 * var7 - var14 * var5 + 0.5D) * tileSize);
+ int var21 = (var19 & tileSizeMask) + (var20 & tileSizeMask) * tileSize;
var10 = this.field_4223_i[var21] >> 24 & 255;
var11 = (this.field_4223_i[var21] >> 16 & 255) * var11 / 255;
var12 = (this.field_4223_i[var21] >> 8 & 255) * var18 / 255;

View file

@ -1,74 +1,82 @@
--- ../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
@@ -16,15 +16,21 @@
@@ -13,6 +13,19 @@
super(Block.field_401_B.field_378_bb);
}
+ @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];
+ }
+ field_1154_k = 0;
+ }
+
public void func_783_a()
{
++this.field_1154_k;
+ if (field_1158_g.length!=textureGridSize) {
+ field_1158_g = new float[textureGridSize];
+ field_1157_h = new float[textureGridSize];
+ field_1156_i = new float[textureGridSize];
+ field_1155_j = new float[textureGridSize];
+ }
int var1;
int var2;
float var3;
@@ -22,9 +35,9 @@
int var5;
int var6;
- for (var1 = 0; var1 < 16; ++var1)
+ for (var1 = 0; var1 < textureLength; ++var1)
+ for (var1 = 0; var1 < tileSize; ++var1)
{
- for (var2 = 0; var2 < 16; ++var2)
+ for (var2 = 0; var2 < textureLength; ++var2)
+ for (var2 = 0; var2 < tileSize; ++var2)
{
var3 = 0.0F;
@@ -32,29 +38,29 @@
@@ -32,29 +45,29 @@
{
var5 = var4 & 15;
var6 = var2 & 15;
- var3 += this.field_1158_g[var5 + var6 * 16];
+ var3 += this.field_1158_g[var5 + var6 * textureLength];
+ var3 += this.field_1158_g[var5 + var6 * tileSize];
}
- this.field_1157_h[var1 + var2 * 16] = var3 / 3.3F + this.field_1156_i[var1 + var2 * 16] * 0.8F;
+ this.field_1157_h[var1 + var2 * textureLength] = var3 / 3.3F + this.field_1156_i[var1 + var2 * textureLength] * 0.8F;
+ this.field_1157_h[var1 + var2 * tileSize] = var3 / 3.3F + this.field_1156_i[var1 + var2 * tileSize] * 0.8F;
}
}
- for (var1 = 0; var1 < 16; ++var1)
+ for (var1 = 0; var1 < textureLength; ++var1)
+ for (var1 = 0; var1 < tileSize; ++var1)
{
- for (var2 = 0; var2 < 16; ++var2)
+ for (var2 = 0; var2 < textureLength; ++var2)
+ for (var2 = 0; var2 < tileSize; ++var2)
{
- this.field_1156_i[var1 + var2 * 16] += this.field_1155_j[var1 + var2 * 16] * 0.05F;
+ this.field_1156_i[var1 + var2 * textureLength] += this.field_1155_j[var1 + var2 * textureLength] * 0.05F;
+ this.field_1156_i[var1 + var2 * tileSize] += this.field_1155_j[var1 + var2 * tileSize] * 0.05F;
- if (this.field_1156_i[var1 + var2 * 16] < 0.0F)
+ if (this.field_1156_i[var1 + var2 * textureLength] < 0.0F)
+ if (this.field_1156_i[var1 + var2 * tileSize] < 0.0F)
{
- this.field_1156_i[var1 + var2 * 16] = 0.0F;
+ this.field_1156_i[var1 + var2 * textureLength] = 0.0F;
+ this.field_1156_i[var1 + var2 * tileSize] = 0.0F;
}
- this.field_1155_j[var1 + var2 * 16] -= 0.1F;
+ this.field_1155_j[var1 + var2 * textureLength] -= 0.1F;
+ this.field_1155_j[var1 + var2 * tileSize] -= 0.1F;
if (Math.random() < 0.05D)
{
- this.field_1155_j[var1 + var2 * 16] = 0.5F;
+ this.field_1155_j[var1 + var2 * textureLength] = 0.5F;
+ this.field_1155_j[var1 + var2 * tileSize] = 0.5F;
}
}
}
@@ -63,7 +69,7 @@
@@ -63,7 +76,7 @@
this.field_1157_h = this.field_1158_g;
this.field_1158_g = var12;
- for (var2 = 0; var2 < 256; ++var2)
+ for (var2 = 0; var2 < textureGridSize; ++var2)
+ for (var2 = 0; var2 < tileSizeSquare; ++var2)
{
var3 = this.field_1158_g[var2];

View file

@ -1,30 +1,36 @@
--- ../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
@@ -16,46 +16,55 @@
@@ -14,6 +14,19 @@
this.field_1129_e = 2;
}
+ @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;
+ }
+
public void func_783_a()
{
+ if (field_1138_g.length!=textureGridSize) {
+ field_1138_g = new float[textureGridSize];
+ field_1137_h = new float[textureGridSize];
+ field_1136_i = new float[textureGridSize];
+ field_1135_j = new float[textureGridSize];
+ }
++this.field_1134_k;
int var1;
int var2;
@@ -22,40 +35,40 @@
float var3;
int var5;
int var6;
+
+ int textureLengthMask=textureLength-1;
+ int textureGridSizeMask=textureGridSize-1;
-
- for (var1 = 0; var1 < 16; ++var1)
+ for (var1 = 0; var1 < textureLength; ++var1)
+
+ for (var1 = 0; var1 < tileSize; ++var1)
{
- for (var2 = 0; var2 < 16; ++var2)
+ for (var2 = 0; var2 < textureLength; ++var2)
+ for (var2 = 0; var2 < tileSize; ++var2)
{
var3 = 0.0F;
@ -33,51 +39,51 @@
- var5 = var1 & 15;
- var6 = var4 & 15;
- var3 += this.field_1138_g[var5 + var6 * 16];
+ var5 = var1 & textureLengthMask;
+ var6 = var4 & textureLengthMask;
+ var3 += this.field_1138_g[var5 + var6 * textureLength];
+ var5 = var1 & tileSizeMask;
+ var6 = var4 & tileSizeMask;
+ var3 += this.field_1138_g[var5 + var6 * tileSize];
}
- this.field_1137_h[var1 + var2 * 16] = var3 / 3.2F + this.field_1136_i[var1 + var2 * 16] * 0.8F;
+ this.field_1137_h[var1 + var2 * textureLength] = var3 / 3.2F + this.field_1136_i[var1 + var2 * textureLength] * 0.8F;
+ this.field_1137_h[var1 + var2 * tileSize] = var3 / 3.2F + this.field_1136_i[var1 + var2 * tileSize] * 0.8F;
}
}
- for (var1 = 0; var1 < 16; ++var1)
+ for (var1 = 0; var1 < textureLength; ++var1)
+ for (var1 = 0; var1 < tileSize; ++var1)
{
- for (var2 = 0; var2 < 16; ++var2)
+ for (var2 = 0; var2 < textureLength; ++var2)
+ for (var2 = 0; var2 < tileSize; ++var2)
{
- this.field_1136_i[var1 + var2 * 16] += this.field_1135_j[var1 + var2 * 16] * 0.05F;
+ this.field_1136_i[var1 + var2 * textureLength] += this.field_1135_j[var1 + var2 * textureLength] * 0.05F;
+ this.field_1136_i[var1 + var2 * tileSize] += this.field_1135_j[var1 + var2 * tileSize] * 0.05F;
- if (this.field_1136_i[var1 + var2 * 16] < 0.0F)
+ if (this.field_1136_i[var1 + var2 * textureLength] < 0.0F)
+ if (this.field_1136_i[var1 + var2 * tileSize] < 0.0F)
{
- this.field_1136_i[var1 + var2 * 16] = 0.0F;
+ this.field_1136_i[var1 + var2 * textureLength] = 0.0F;
+ this.field_1136_i[var1 + var2 * tileSize] = 0.0F;
}
- this.field_1135_j[var1 + var2 * 16] -= 0.3F;
+ this.field_1135_j[var1 + var2 * textureLength] -= 0.3F;
+ this.field_1135_j[var1 + var2 * tileSize] -= 0.3F;
if (Math.random() < 0.2D)
{
- this.field_1135_j[var1 + var2 * 16] = 0.5F;
+ this.field_1135_j[var1 + var2 * textureLength] = 0.5F;
+ this.field_1135_j[var1 + var2 * tileSize] = 0.5F;
}
}
}
@@ -64,9 +73,9 @@
@@ -64,9 +77,9 @@
this.field_1137_h = this.field_1138_g;
this.field_1138_g = var12;
- for (var2 = 0; var2 < 256; ++var2)
+ for (var2 = 0; var2 < textureGridSize; ++var2)
+ for (var2 = 0; var2 < tileSizeSquare; ++var2)
{
- var3 = this.field_1138_g[var2 - this.field_1134_k * 16 & 255];
+ var3 = this.field_1138_g[var2 - this.field_1134_k * textureLength & textureGridSizeMask];
+ var3 = this.field_1138_g[var2 - this.field_1134_k * tileSize & tileSizeSquareMask];
if (var3 > 1.0F)
{