The Twilight Forest

The Twilight Forest

140M Downloads

[1.19.2] Server crashes during pregen

lunarpatriots opened this issue ยท 17 comments

commented

Forge Version

43.1.57

Twilight Forest Version

4.2.1468

Client Log

https://gist.githubusercontent.com/lunarpatriots/86560b3ec14de6cfd33173688844c98e/raw/6e4545dc222c867d11474360e3676a411bf3f4f7/latest.log

Crash Report (if applicable)

https://gist.github.com/lunarpatriots/90dcfac178119bd90d925fae0cbb1b6f#file-crash-2022-11-30_15-42-37-server-txt

Steps to Reproduce

Pregen twilight forest dimension using Chunky (or any other pregen mod)

What You Expected

Twilight Forest will pregen without any issues

What Happened Instead

Server crashes when pregen reaches a chunk with the Final Castle structure

Additional Details

No response

Please Read and Confirm The Following

  • I have confirmed this bug can be replicated without the use of Optifine.
  • I have confirmed the details provided in this report are concise as possible and does not contained vague information (ie. Versions are properly recorded, answers to questions are clear).
  • I have confirmed this issue is unique and has not been reported already.
commented

I have the same issue on fabric, due to the LichTower generation it seems to error out, and says the bound must be positive. Initially blamed c2me, but its not unique to fabric. My log is below, but out of curiosity, can you edit the chunky config to not auto resume, then try manually loading it up? I managed to load it all fine that way, and will just load manually in future until fixed.
Log: https://pastebin.com/SHxgw6na

It's actually not configured to resume automatically, I run chunky continue manually everytime I restart the server when it crashes. But I can try doing that a couple more times, and we'll see if it finally manages to continue without crashing.

I didn't explain well, load the chunks as you would exploring, not with chunky. I ran several attempts to generate the chunks with Chunky, the server crashes each time at the same point. Only when I manually logged into the world and loaded the area did it load correctly.

This didn't work, sadly. Getting near that chunk crashes the server with the same error as before.

Dang, it seems to work for me, or I generated the wrong towers lmao. The error in question relates to this code below:

protected void makeGlyphBranches(WorldGenLevel world, RandomSource rand, BlockState colour, BoundingBox sbb) {
	    // pick a random side of the tower
	    Rotation rotation = RotationUtil.ROTATIONS[rand.nextInt(4)];

	// start somewhere in the lower part
	int startHeight = rand.nextInt((int) (this.height * 0.66F));

	// near the middle
	int startZ = 3 + rand.nextInt(this.size - 6);

	// make a line all the way down to the foundation
	int dx = this.getXWithOffsetRotated(0, startZ, rotation);
	int dz = this.getZWithOffsetRotated(0, startZ, rotation);
	if (sbb.isInside(new BlockPos(dx, this.boundingBox.minY() + 1, dz))) {
		for (int dy = this.getWorldY(startHeight); dy > 0; dy--) {
			final BlockPos pos = new BlockPos(dx, dy, dz);
			if (world.getBlockState(pos).is(BlockTagGenerator.CASTLE_BLOCKS) && world.getBlockState(pos).isRedstoneConductor(world, pos)) {
				world.setBlock(pos, colour, 2);
			} else {
				break;
			}
		}
	}

	// go left a little
	int leftOffset = startZ - (1 + rand.nextInt(3));
	int leftHeight = rand.nextInt(this.height - startHeight);
	if (leftOffset >= 0) {
		for (int z = startZ; z > leftOffset; z--) {
			this.setBlockStateRotated(world, colour, 0, startHeight, z, rotation, sbb);
		}
		for (int y = startHeight; y < (startHeight + leftHeight); y++) {
			this.setBlockStateRotated(world, colour, 0, y, leftOffset, rotation, sbb);
		}
	}

	// go right a little
	int rightOffset = startZ + (1 + rand.nextInt(3));
	int rightHeight = rand.nextInt(this.height - startHeight);
	if (rightOffset < this.size - 1) {
		for (int z = startZ; z < rightOffset; z++) {
			this.setBlockStateRotated(world, colour, 0, startHeight, z, rotation, sbb);
		}
		for (int y = startHeight; y < (startHeight + rightHeight); y++) {
			this.setBlockStateRotated(world, colour, 0, y, rightOffset, rotation, sbb);
		}
	}
}

So Devs can probably fix it eventually.

commented

I have the same issue on fabric, due to the LichTower generation it seems to error out, and says the bound must be positive. Initially blamed c2me, but its not unique to fabric. My log is below, but out of curiosity, can you edit the chunky config to not auto resume, then try manually loading it up? I managed to load it all fine that way, and will just load manually in future until fixed.

Log: https://pastebin.com/SHxgw6na

It's actually not configured to resume automatically, I run chunky continue manually everytime I restart the server when it crashes. But I can try doing that a couple more times, and we'll see if it finally manages to continue without crashing.

commented

I have the same issue on fabric, due to the LichTower generation it seems to error out, and says the bound must be positive. Initially blamed c2me, but its not unique to fabric. My log is below, but out of curiosity, can you edit the chunky config to not auto resume, then try manually loading it up? I managed to load it all fine that way, and will just load manually in future until fixed.

Log: https://pastebin.com/SHxgw6na

commented

I have the same issue on fabric, due to the LichTower generation it seems to error out, and says the bound must be positive. Initially blamed c2me, but its not unique to fabric. My log is below, but out of curiosity, can you edit the chunky config to not auto resume, then try manually loading it up? I managed to load it all fine that way, and will just load manually in future until fixed.
Log: https://pastebin.com/SHxgw6na

It's actually not configured to resume automatically, I run chunky continue manually everytime I restart the server when it crashes. But I can try doing that a couple more times, and we'll see if it finally manages to continue without crashing.

I didn't explain well, load the chunks as you would exploring, not with chunky. I ran several attempts to generate the chunks with Chunky, the server crashes each time at the same point. Only when I manually logged into the world and loaded the area did it load correctly.

commented

I have the same issue on fabric, due to the LichTower generation it seems to error out, and says the bound must be positive. Initially blamed c2me, but its not unique to fabric. My log is below, but out of curiosity, can you edit the chunky config to not auto resume, then try manually loading it up? I managed to load it all fine that way, and will just load manually in future until fixed.
Log: https://pastebin.com/SHxgw6na

It's actually not configured to resume automatically, I run chunky continue manually everytime I restart the server when it crashes. But I can try doing that a couple more times, and we'll see if it finally manages to continue without crashing.

I didn't explain well, load the chunks as you would exploring, not with chunky. I ran several attempts to generate the chunks with Chunky, the server crashes each time at the same point. Only when I manually logged into the world and loaded the area did it load correctly.

This didn't work, sadly. Getting near that chunk crashes the server with the same error as before.

commented

this issue should be fixed in both the 1.19.2 and 1.18.2 versions for forge once they go live on curseforge. You'll have to wait a bit longer for the fabric fixes

commented

this issue should be fixed in both the 1.19.2 and 1.18.2 versions for forge once they go live on curseforge. You'll have to wait a bit longer for the fabric fixes

Beautiful, Thanks so much for the work put in, and for fixing this :D

commented

this issue should be fixed in both the 1.19.2 and 1.18.2 versions for forge once they go live on curseforge. You'll have to wait a bit longer for the fabric fixes

Unfortunately, it's still crashing.

Log: https://mclo.gs/UHdC0Cf
Crash report (no file generated, but logged in console) https://mclo.gs/IKCxAEd

commented

That settles it, then: something is causing the height value of the castle to become 0. We have extensively tested this but have not been able to reproduce this on our end, even trying to force it to crash by quitting the world before the castle can generate.

Can this be reproduced with only Twilight Forest? I feel as though due to the sheer number of mods, it's causing seeds to generate differently.

commented

That settles it, then: something is causing the height value of the castle to become 0. We have extensively tested this but have not been able to reproduce this on our end, even trying to force it to crash by quitting the world before the castle can generate.

Can this be reproduced with only Twilight Forest? I feel as though due to the sheer number of mods, it's causing seeds to generate differently.

The logs I attached on my last comment was from an instance with only Twilight Forest and Chunky.

And here's the logs with only Twilight Forest and no Chunky: https://mclo.gs/l8m51QA

commented

Just out of curiosity, is the Final Castle Structure intact? The errors come from it.

commented

Just out of curiosity, is the Final Castle Structure intact? The errors come from it.

Not sure if this is intended generation. The castle loaded, at least.

2023-01-17_16 42 53

EDIT: Castle view from another angle

2023-01-17_16 54 21

commented

Interesting. In that second shot, the castle does appear to be fully intact, the first just looks like what happens when towers are allowed to generate so far away from the Plateau area.

I'll keep a note of that, there might be a spot I've seen where the error could come from.

commented

alright we finally got around to pushing a build for this. The latest 1.19.2 should fix this issue for good

commented

I'm apparently still encountering this issue on 1.19.2 Fabric (twilightforest-fabric-1.19.2-4.2.357)

Caused by: java.lang.IllegalArgumentException: Bound must be positive
at net.minecraft.class_6566.method_43048(class_6566.java:22) ~[server-intermediary.jar:?]
at twilightforest.world.components.structures.lichtower.TowerWingComponent.makeGlyphBranches(TowerWingComponent.java:1939) ~[twilightforest-fabric-1.19.2-4.2.357.jar:?]
at twilightforest.world.components.structures.finalcastle.FinalCastleMazeTower13Component.method_14931(FinalCastleMazeTower13Component.java:465) ~[twilightforest-fabric-1.19.2-4.2.357.jar:?]

The moment we approach the Final Tower the server crashes and a rollback is required.