Terasology-Archived / AdditionalWorlds

A collection of interesting world generators
0 stars 18 forks source link

World generator plugin issues #27

Closed PAndaContron closed 5 years ago

PAndaContron commented 6 years ago

It seems like a few of the world generators don't function properly because of their lakes being added as plugins. This is probably because everyone followed the tutorial where lakes were implemented this way. This leads to issues where the lakes from one generator interfere with another, causing crashes or hangs.

The "I'm getting thirsty" and "Lava Land" generators crash with the following error:

java.lang.RuntimeException: Cannot set a changed component with a null component variable
        at org.terasology.persistence.internal.EntityDelta.setChangedComponent(EntityDelta.java:34)
        at org.terasology.persistence.internal.EntitySetDeltaRecorder.onEntityComponentChange(EntitySetDeltaRecorder.java:70)
        at org.terasology.persistence.internal.EntitySetDeltaRecorder.onEntityComponentAdded(EntitySetDeltaRecorder.java:61)
        at org.terasology.persistence.internal.ReadWriteStorageManager.onEntityComponentAdded(ReadWriteStorageManager.java:528)
        at org.terasology.entitySystem.entity.internal.PojoEntityManager.notifyComponentAdded(PojoEntityManager.java:704)
        at org.terasology.entitySystem.entity.internal.PojoEntityManager.addComponent(PojoEntityManager.java:539)
        at org.terasology.entitySystem.entity.internal.BaseEntityRef.addComponent(BaseEntityRef.java:167)
        at org.terasology.engine.modes.loadProcesses.CreateWorldEntity.step(CreateWorldEntity.java:102)
        at org.terasology.engine.modes.StateLoading.update(StateLoading.java:243)
        at org.terasology.engine.TerasologyEngine.tick(TerasologyEngine.java:458)
        at org.terasology.engine.TerasologyEngine.mainLoop(TerasologyEngine.java:421)
        at org.terasology.engine.TerasologyEngine.run(TerasologyEngine.java:397)
        at org.terasology.engine.Terasology.main(Terasology.java:155)

Additionally, world generators outside of this module which use plugins will hang indefinitely while trying to load the lakes from "TropikGenerator", printing this stacktrace to console over and over:

java.lang.NullPointerException: null
        at org.terasology.additionalworlds.imgettingthirsty.LakesRasterizer.generateChunk(LakesRasterizer.java:43)
        at org.terasology.world.generation.WorldImpl.rasterizeChunk(WorldImpl.java:64)
        at org.terasology.world.generation.BaseFacetedWorldGenerator.createChunk(BaseFacetedWorldGenerator.java:75)
        at org.terasology.world.chunks.localChunkProvider.LocalChunkProvider$1.run(LocalChunkProvider.java:657)
        at org.terasology.utilities.concurrency.TaskProcessor.run(TaskProcessor.java:50)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

This issue could be fixed simply by changing the implementations of lakes in every generator to use regular Providers and Rasterizers rather than plugins.

PAndaContron commented 6 years ago

The "I'm getting thirsty" generator seems to have another issue in it with the MountainsProvider configuration which causes the same error. The lakes plugin is most likely still causing an error though, since the Lake Rasterizer and Provider seem to be identical to the classes in Lava Land, where they do cause an error.