mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 20:52:34 +00:00
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.
(cherry picked from commit 7da6c2d0e1)
This commit is contained in:
1 parent
b2964a1ae7
commit
b16994717f
3 files changed
+28
-17
No files matched your search
@@ -110,6 +110,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;
|
||||
@@ -296,6 +297,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())
|
||||
@@ -320,30 +328,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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user