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 2017-01-17 13:34:03 -08:00
parent 50bf03b82b
commit 7da6c2d0e1
3 changed files with 28 additions and 17 deletions

View file

@ -84,6 +84,15 @@
this.func_180443_s();
@@ -933,7 +948,7 @@
BlockPos blockpos2 = renderchunk4.func_178568_j().func_177982_a(8, 8, 8);
boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D;
- if (!renderchunk4.func_188281_o() && !flag3)
+ if (net.minecraftforge.common.ForgeModContainer.alwaysSetupTerrainOffThread || (!renderchunk4.func_188281_o() && !flag3))
{
this.field_175009_l.add(renderchunk4);
}
@@ -1220,6 +1235,13 @@
public void func_174976_a(float p_174976_1_, int p_174976_2_)

View file

@ -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();
}
}
}
}

View file

@ -50,6 +50,8 @@ forge.configgui.forgeLightPipelineEnabled=Forge Light Pipeline Enabled
forge.configgui.java8Reminder=Java 8 Reminder timestamp
forge.configgui.disableStairSlabCulling=Disable Stair/Slab culling.
forge.configgui.disableStairSlabCulling.tooltip=Enable this if you see through blocks touching stairs/slabs with your resource pack.
forge.configgui.alwaysSetupTerrainOffThread=Force threaded chunk rendering
forge.configgui.alwaysSetupTerrainOffThread.tooltip=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.
forge.configgui.modID.tooltip=The mod ID that you want to define override settings for.
forge.configgui.modID=Mod ID