Citadel

Citadel

115M Downloads

level.dat Biome Rules Recurse Infinitely [Problem Area Identified, just needs fix]

ByThePowerOfScience opened this issue ยท 7 comments

commented

Seems to be the exact same issue as #101, but on the latest version of Citadel. Happening consistently with this pack on all platforms, and both client and server-side.

I spent like twelve hours straight going through it with a debugger trying to find why it was doing that, so if you need any more information, please let me know.

Citadel: citadel-2.6.0-1.20.1
TerraBlender: Disabled

Modpack: Epoch Arcanus

level.dat.txt (an extension that GitHub will accept)
NBTExplorer_2024-11-09_00-00-37

commented

It looks like it might be an incompatibility with Luminous: Nether, though how an MCreator mod could do that is beyond me.

Here's a stringified version of the level.dat I managed to get the server jar to generate: level.txt.gz

(That was so nostalgic btw, having to modify the server jar to bypass the limit. Amazing to see how old-fashioned Minecraft mods were made, down to deleting META-INF to get rid of the checksums and signing.)

commented

Removing Luminous: Nether did not, in fact, fix it. However, I think I found the cause.

private boolean mergedSurfaceRules = false;
@Inject(method = "surfaceRule", at = @At("HEAD"))
private void surfaceRule(CallbackInfoReturnable<SurfaceRules.RuleSource> cir) {
if (!this.mergedSurfaceRules) {
this.surfaceRule = SurfaceRulesManager.mergeOverworldRules(surfaceRule);
this.mergedSurfaceRules = true;
//not replacing the return result for compatibility with TerraBlender
}
}

In mixin.NoiseGeneratorSettingsMixin, the biome rules are appended to the existing ones unless mergedSurfaceRules is set to true. However, this does not take into account the fact that the previously injected biome rules were actually already deserialized and exist there already. So it just keeps adding them onto the end of the list, forever.

No mod incompatibility, just a Citadel bug because the mergedSurfaceRules flag doesn't persist between restarts.

commented

what exactly would the fix be here? storing mergedSurfaceRules somewhere that gets saved across restarts?

Yeah, pretty much.

Alternately, use MixinExtras' @ModifyReturnValue to allow compat with Terrablender without saving state, instead of modifying this.surfaceRule.

commented

So is this what's causing the worldgen to be so incredibly slow after playing on the server awhile? Is there a fix for this aside from removing Citadel and all mods that require it?

commented

Id like to know as well. Ive been searching for a solution for the past 2 months. Frustrating

commented

Id like to know as well. Ive been searching for a solution for the past 2 months. Frustrating

So is this what's causing the worldgen to be so incredibly slow after playing on the server awhile? Is there a fix for this aside from removing Citadel and all mods that require it?

Until the issue is resolved in the mod, the only way to fix it temporarily is to open up level.dat in NBTExplorer and remove the infinitely recursing rule.

commented

what exactly would the fix be here? storing mergedSurfaceRules somewhere that gets saved across restarts?