Waystone crashes villages if the second or third waystone is at end of village pieces.
TelepathicGrunt opened this issue · 1 comments
Some people have been getting crashes that were super strange to figure out. https://pastebin.com/qr9iiaUT
Mapped showed that the issue lied in NoiseChunkGenerator due to some sort of array out of bounds issue.
After some debugging, we got a list of mods that mixin into that class.
From there, I went through each mod's mixin and found this line of code in Waystone. I had the user remove waystone and the crash went away.
So it seems that because this is removing by index, that means after 1 element is removed, all other indices are now incorrect and if any indices were pointing at the end of the array, those will cause the index out of bounds crash.
Hope this helps make it easy to fix the issue! For now, the solution is to remove Waystone, generate the village, and put it back on.
Oh yeah, one more thing, could you try moving the logic out of the mixin into a non-mixin class? By that I mean, have the mixin call a method in your own class. Then do your stuff there so that if it crashes, your mod’s class will show in the stacktrace and make it much easier to debug crashes! I should do this myself more often as well.