Pandoras Creatures

Pandoras Creatures

3M Downloads

[BUG][1.15.2]Trying to do /locate command on End Prison can cause the world to hang under certain circumstances

TelepathicGrunt opened this issue ยท 2 comments

commented

When using Pandoras Creatures with any other mod that imports structures into their own dimension, using /locate for the End Prison structure will cause the game to hang forever and need task manager to force close it. This can easily be reproduced by using World Blender and Pandoras Creatures along by configuring world blender to import structures into its own dimension.

My suspicion on this hang is that it is caused by this line of code.
https://github.com/andrew0030/Pandoras-Creatures/blob/master/src/main/java/andrews/pandoras_creatures/world/structures/end_prison/EndPrisonStructure.java#L59

What I think is happening is since world blender imports both end cities and the End Prison to it's biomes, using the locate command will always return false for every chunk since the biome will always have an end city which means the locate command will keep running forever looking for a chunk that can return true.

This check is also perplexing as well as you should be filtering out biomes with End Cities when add your structure to biomes instead of doing it in structure gen. Doing filtering when adding structure is the best practice to do.

for(Biome biome : BiomeDictionary.getBiomes(Type.END))

A simple if(biome.hasStructure(Feature.END_CITY) check in that loop will add your End Prison to all end biomes without end cities which will reproduce the result you want and you can remove that if(!chunkGen.hasStructure(biome, Feature.END_CITY)) out of the EndPrisonStructure class.

Hopefully this will resolve the hang and will help with mod compatibility! Let me know if you need more info.

commented

Just uploaded an updated version of the Mod to curse that fixed this issue (Mod Version 1.15.2-1.0.1), sorry it took a while I have been busy. If you find more bugs point them out :D
p.s. if it isn't available on curse when you read this, the file is probably still being processed.

commented

Ok lets see, I looked into it and made sure to run the locate command in the overworld. That seems to work fine. Now for this special case where you import both structures into all biomes yes that line of code would indeed cause an issue like that. I will remove it and it should be fixed next update, thanks for pointing it out.