Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ExampleConfiguration.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ general {
# Max: 240
I:HudCachingFPSLimit=20

# Disable HudCaching in specified dimension IDs.
# Example: 0 for Overworld, -1 for Nether, 1 for The End.
# Use this to avoid render issues in dimensions with custom rendering.
I:HudCachingDimensionBlacklist <
>

# (Client Performance) Modify the data structure of ModelBlock's textures map to improve performance and reduce memory usage.
# This feature requires CensoredASM mod.
# Known to be incompatible with DynamicTrees.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ public static void renderCachedHud(EntityRenderer renderer, GuiIngame ingame, fl
ingame.renderGameOverlay(partialTicks);
return;
}

if (isCurrentDimensionBlacklisted()) {
dirty = true;
ingame.renderGameOverlay(partialTicks);
renderIGIOverlayIfRequiredWhenBypassed(partialTicks);
return;
}

GlStateManager.enableDepth();
ScaledResolution resolution = new ScaledResolution(MC);
int width = resolution.getScaledWidth();
Expand Down Expand Up @@ -107,6 +115,31 @@ public static void renderCachedHud(EntityRenderer renderer, GuiIngame ingame, fl
}
}

private static void renderIGIOverlayIfRequiredWhenBypassed(float partialTicks) {
if (StellarCoreConfig.PERFORMANCE.vanilla.hudCaching && Loader.isModLoaded("ingameinfoxml") && StellarCoreConfig.PERFORMANCE.inGameInfoXML.hudFrameBuffer) {
renderIGIOverlay(partialTicks);
}
}

private static boolean isCurrentDimensionBlacklisted() {
if (MC.world == null || MC.world.provider == null) {
return false;
}

int currentDim = MC.world.provider.getDimension();
int[] blacklist = StellarCoreConfig.PERFORMANCE.vanilla.hudCachingDimensionBlacklist;
if (blacklist == null || blacklist.length == 0) {
return false;
}

for (int dimId : blacklist) {
if (dimId == currentDim) {
return true;
}
}
return false;
}

@Optional.Method(modid = "ingameinfoxml")
private static void renderIGIOverlay(float partialTicks) {
igiRendering = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ public static class Vanilla {
@Config.Name("HudCachingFPSLimit")
public int hudCachingFPSLimit = 20;

@Config.Comment({
"Disable HudCaching in specified dimension IDs.",
"Example: 0 for Overworld, -1 for Nether, 1 for The End.",
"Use this to avoid render issues in dimensions with custom rendering."
})
@Config.Name("HudCachingDimensionBlacklist")
public int[] hudCachingDimensionBlacklist = {};

@Config.Comment({
"(Client Performance | Experimental) A feature that helps speed up game loading by modifying the model loader's code to enable parallel loading capabilities (5s ~ 40s faster).",
"Incompatible with some mod's models because they use their own model loader, if you encounter a missing model, please report it to the StellarCore author for manual compatibility.",
Expand Down