Dungeon Crawl

Dungeon Crawl

49M Downloads

[1.14.4] Structure.hasStartAt somehow trying to instantiate array with negative size

noobanidus opened this issue ยท 2 comments

commented

See crash report here.

It appesrs that the Dungeon::hasStartAt is using very similar code to say, the Woodland Mansion, on 95 and 96:

	for (Biome biome : chunkGen.getBiomeProvider().getBiomesInSquare(chunkPosX * 16 + SIZE / 2 * 8,
					chunkPosZ * 16 + SIZE / 2 * 8, 8 * SIZE)) {

However, in this instance, going through the different calls, the crash is occurring at line 21 of Layer.java, in generateBiomes: Biome[] abiome = new Biome[xSize * zSize];

The implication here is that, somehow, xSize * zSize (which is derived from some bit shifting within getBiomesInSquare, and then initially from the centerX/centerZ + sideLength passed in as per above, is resulting in a negative value, which is then being used to instantiate an array.

I'm not sure of the different values that you're using, thankfully the crash report actually have the relevant chunks and region information that might be able to help you back-trace the error.

commented

Okay, thank you for the information. However, the link you provided seems to lead to the Dungeon#hasStartAt function in the code and not to the crash report. :)

commented

My bad, I was failing to multitask. This should be the correct link