Skip to content

Commit

Permalink
Abort cloak render with Optifine.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunstrike committed Dec 1, 2013
1 parent e763bb6 commit cc241aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/tconstruct/client/event/EventCloakRender.java
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.event.ForgeSubscribe;
import tconstruct.util.EnvironmentChecks;

public class EventCloakRender
{
Expand All @@ -32,7 +33,7 @@ public EventCloakRender()
@ForgeSubscribe
public void onPreRenderSpecials (RenderPlayerEvent.Specials.Pre event)
{
if (Loader.isModLoaded("shadersmod"))
if (Loader.isModLoaded("shadersmod") || EnvironmentChecks.hasOptifine)
{
return;
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/tconstruct/util/EnvironmentChecks.java
Expand Up @@ -13,6 +13,9 @@
public class EnvironmentChecks
{

// Used for aborting cloak renders with Optifine present (it misbehaves)
public static boolean hasOptifine = false;

private EnvironmentChecks()
{
} // Singleton
Expand All @@ -33,8 +36,9 @@ public static void verifyEnvironmentSanity ()

if (FMLCommonHandler.instance().getSide() == Side.CLIENT && FMLClientHandler.instance().hasOptifine() || Loader.isModLoaded("optifine"))
{
TConstruct.logger.severe("[Environment Checks] Optifine detected. This is a Bad Thing(tm) and can crash Minecraft due to an Optifine bug during TCon armor renders!");
TConstruct.logger.severe("[Environment Checks] Optifine detected. This is a Bad Thing(tm) and can crash Minecraft due to an Optifine bug during TCon armor renders! Capes also disabled.");
modIds.add("optifine");
hasOptifine = true;
}

try
Expand Down

0 comments on commit cc241aa

Please sign in to comment.