Terasology / SimpleFarming

Easy to understand growing of foods
11 stars 27 forks source link

Add check for Genome optional dependency #103

Closed vedant-shroff closed 3 years ago

vedant-shroff commented 4 years ago

Fixes the following error that was logged during the week long playtest server running MetalRenegades which includes SimpleFarming

10:32:08.121 [main] ERROR o.t.engine.ComponentSystemManager - Failed to load system SimpleFarming:GenomeAuthoritySystem
java.lang.NoClassDefFoundError: org/terasology/genome/breed/mutator/GeneMutator
        at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
        at java.base/java.lang.Class.getConstructor0(Class.java:3342)
        at java.base/java.lang.Class.newInstance(Class.java:556)
        at org.terasology.engine.ComponentSystemManager.loadSystems(ComponentSystemManager.java:99)
        at org.terasology.engine.modes.loadProcesses.RegisterSystems.step(RegisterSystems.java:54)
        at org.terasology.engine.modes.StateLoading.update(StateLoading.java:237)
        at org.terasology.engine.TerasologyEngine.tick(TerasologyEngine.java:472)
        at org.terasology.engine.TerasologyEngine.mainLoop(TerasologyEngine.java:435)
        at org.terasology.engine.TerasologyEngine.run(TerasologyEngine.java:411)
        at org.terasology.engine.Terasology.main(Terasology.java:155)

The optional dependency of Genome is checked before loading the system, rather than relying on an error to cause the system to fail to load.

How to test :