mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-14 20:20:30 +00:00
Fix Optifine detection
I really should have tested this. And not expected Optifine to be normal.
This commit is contained in:
parent
cbbab26bf3
commit
074793090d
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* This file is part of ComputerCraft - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission.
|
||||
* Send enquiries to dratcliffe@gmail.com
|
||||
*/
|
||||
package dan200.computercraft.shared.integration;
|
||||
|
||||
/**
|
||||
* Detect whether Optifine is installed.
|
||||
*/
|
||||
public final class Optifine
|
||||
{
|
||||
private static final boolean LOADED;
|
||||
|
||||
static
|
||||
{
|
||||
boolean loaded;
|
||||
try
|
||||
{
|
||||
Class.forName( "optifine.Installer", false, Optifine.class.getClassLoader() );
|
||||
loaded = true;
|
||||
}
|
||||
catch( ReflectiveOperationException | LinkageError ignore )
|
||||
{
|
||||
loaded = false;
|
||||
}
|
||||
|
||||
LOADED = loaded;
|
||||
}
|
||||
|
||||
private Optifine()
|
||||
{
|
||||
}
|
||||
|
||||
public static boolean isLoaded()
|
||||
{
|
||||
return LOADED;
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ package dan200.computercraft.shared.peripheral.monitor;
|
||||
|
||||
import dan200.computercraft.ComputerCraft;
|
||||
import dan200.computercraft.client.render.TileEntityMonitorRenderer;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import dan200.computercraft.shared.integration.Optifine;
|
||||
import org.lwjgl.opengl.GL;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@ -60,7 +60,7 @@ public enum MonitorRenderer
|
||||
return VBO;
|
||||
}
|
||||
|
||||
if( ModList.get().isLoaded( "optifine" ) )
|
||||
if( Optifine.isLoaded() )
|
||||
{
|
||||
ComputerCraft.log.warn( "Optifine is loaded, assuming shaders are being used. Falling back to VBO monitor renderer." );
|
||||
return VBO;
|
||||
|
Loading…
Reference in New Issue
Block a user