New client config option to force all chunk rendering off the main thread.

This may help FPS issues, but may also result in world holes/rendering issues.
Also fix Forge configs not saving properly.
This commit is contained in:
LexManos committed 2017-01-17 13:34:03 -08:00
1 parent 50bf03b82b
commit 7da6c2d0e1
3 files changed
+28 -17

No files matched your search

@@ -114,6 +114,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
public static boolean replaceVanillaBucketModel = true;
public static long java8Reminder = 0;
public static boolean disableStairSlabCulling = false; // Also known as the "DontCullStairsBecauseIUseACrappyTexturePackThatBreaksBasicBlockShapesSoICantTrustBasicBlockCulling" flag
public static boolean alwaysSetupTerrainOffThread = false; // In RenderGlobal.setupTerrain, always force the chunk render updates to be queued to the thread
private static Configuration config;
private static ForgeModContainer INSTANCE;
@@ -300,6 +301,13 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
prop.setLanguageKey("forge.configgui.disableStairSlabCulling").setRequiresMcRestart(false);
propOrder.add(prop.getName());
prop = config.get(Configuration.CATEGORY_CLIENT, "alwaysSetupTerrainOffThread", Boolean.FALSE,
"Enable forge to queue all chunk updates to the Chunk Update thread. May increase FPS significantly, but may also cause weird rendering lag. Not recommended for computers " +
"without a significant number of cores available.");
alwaysSetupTerrainOffThread = prop.getBoolean(Boolean.FALSE);
prop.setLanguageKey("forge.configgui.alwaysSetupTerrainOffThread");
propOrder.add(prop.getName());
config.setCategoryPropertyOrder(CATEGORY_CLIENT, propOrder);
if (config.hasChanged())
@@ -324,30 +332,22 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
{
if (getMetadata().modId.equals(event.getModID()))
{
if (!event.isWorldRunning())
if ("chunkLoader".equals(event.getConfigID()))
{
if (Configuration.CATEGORY_GENERAL.equals(event.getConfigID()))
{
syncConfig(false);
}
else if ("chunkLoader".equals(event.getConfigID()))
{
ForgeChunkManager.syncConfigDefaults();
ForgeChunkManager.loadConfiguration();
}
else if (VERSION_CHECK_CAT.equals(event.getConfigID()))
{
syncConfig(false);
}
ForgeChunkManager.syncConfigDefaults();
ForgeChunkManager.loadConfiguration();
}
else
{
boolean tmp = config.get(Configuration.CATEGORY_CLIENT, "disableStairSlabCulling", disableStairSlabCulling).getBoolean();
if (disableStairSlabCulling != tmp)
boolean tmpStairs = disableStairSlabCulling;
syncConfig(false);
if (event.isWorldRunning() && tmpStairs != disableStairSlabCulling)
{
disableStairSlabCulling = tmp;
FMLCommonHandler.instance().reloadRenderers();
}
}
}
}