Added hackish workaround for Tessellator.textureID to provent crashing while we wait for Optifine to update.
This commit is contained in:
parent
f22e065187
commit
5127e56029
1 changed files with 19 additions and 2 deletions
|
@ -36,6 +36,8 @@ import static net.minecraft.src.forge.IItemRenderer.ItemRendererHelper.*;
|
|||
|
||||
public class ForgeHooksClient
|
||||
{
|
||||
private static Field textureID = null;
|
||||
private static boolean textureIDChecked = false;
|
||||
|
||||
public static boolean onBlockHighlight(RenderGlobal render, EntityPlayer player, MovingObjectPosition target, int i, ItemStack itemstack, float partialTicks)
|
||||
{
|
||||
|
@ -135,7 +137,22 @@ public class ForgeHooksClient
|
|||
if (tess == null)
|
||||
{
|
||||
tess = new Tessellator();
|
||||
tess.textureID = texture;
|
||||
//Hack around for waiting for Optifine to implement the feature he requested.
|
||||
//Should make it not cause while we wait for him to update.
|
||||
if (!textureIDChecked && textureID == null)
|
||||
{
|
||||
textureIDChecked = true;
|
||||
try
|
||||
{
|
||||
textureID = Tessellator.class.getField("textureID");
|
||||
}
|
||||
catch (NoSuchFieldException ex){}
|
||||
}
|
||||
if (textureID != null)
|
||||
{
|
||||
tess.textureID = texture;
|
||||
}
|
||||
//End Hack
|
||||
tessellators.put(key, tess);
|
||||
}
|
||||
if (inWorld && !renderTextures.contains(key))
|
||||
|
|
Loading…
Reference in a new issue