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
|
@ -36,7 +36,9 @@ import static net.minecraft.src.forge.IItemRenderer.ItemRendererHelper.*;
|
||||||
|
|
||||||
public class ForgeHooksClient
|
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)
|
public static boolean onBlockHighlight(RenderGlobal render, EntityPlayer player, MovingObjectPosition target, int i, ItemStack itemstack, float partialTicks)
|
||||||
{
|
{
|
||||||
for (IHighlightHandler handler : highlightHandlers)
|
for (IHighlightHandler handler : highlightHandlers)
|
||||||
|
@ -135,7 +137,22 @@ public class ForgeHooksClient
|
||||||
if (tess == null)
|
if (tess == null)
|
||||||
{
|
{
|
||||||
tess = new Tessellator();
|
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);
|
tessellators.put(key, tess);
|
||||||
}
|
}
|
||||||
if (inWorld && !renderTextures.contains(key))
|
if (inWorld && !renderTextures.contains(key))
|
||||||
|
|
Loading…
Reference in New Issue