[1.14-1.18] Crash with Poi Override
Speiger opened this issue ยท 5 comments
o/
I am the dev of Chunkpregenerator, and I am thinking of a Fabric port.
The moment I am actually porting my mod over it will be incompatible with Lithium, which I would like to avoid.
This is due to a missing implementation in lithium and a Bug in minecraft.
As you know Minecraft never unloads POIs, this is a massive memory leak that a Pregenerator can not keep alive without running into major issues.
So ChunkPregen removes points of interest as the generating happens.
This issue was found with RoadRunner (Un/offical port of lithium to forge) MaxNeedsSnacks/roadrunner#21
and was a 2 part fix.
ChunkPregen was overriding the Map that lithium was overriding itself, which was chunkpregens bug and is fixed for both sides.
Lithium doesn't delete pois though. Even so the remove function is kinda supported which leaded crashes too.
Roadrunner already implemented a fix for that. But lithium doesn't have that patch.
If I decide to port to fabric I would love that Lithium works with ChunkPregenerator since both mods compliment each other really well.
Edit here is the code referenced in Lithium:
https://github.com/CaffeineMC/lithium-fabric/blob/1.18.x%2Fdev/src/main/java/me/jellysquid/mods/lithium/mixin/ai/poi/SerializingRegionBasedStorageMixin.java#L55
I don't really know how we can make both mods be compatible easily.
I think disabling lithium's optimization with mixin.ai.poi=false
is reasonable. You can also do this from your mod #74
@2No2Name look at Roadrunners patch. It would be exactly the same fix.
It was tested and works perfectly fine. (Roadrunner is basically a fork of Lithium)
@2No2Name
here is the exact commit that fixes it from Roadrunner:
MaxNeedsSnacks/roadrunner@d5d87ed