MaxenceDC / sparsestructures

A simple and configurable one-mixin mod that makes all (even datapacks and modded) structures more spread out (or more common!), essentially making them rarer/easier to find. Useful in big modpacks with a lot of structures mod to encourage exploration and make the experience more challenging or balanced.
https://modrinth.com/mod/sparsestructures
MIT License
4 stars 4 forks source link

Failed to load due to SparseStructuresConfig.customSpreadFactors() #10

Open PapiOphidian opened 8 months ago

PapiOphidian commented 8 months ago

When attempting to load a dedicated server with sparsestructures 2.1 (1.20.2), every structure fails to load because the return value of SparseStructuresConfig.customSpreadFactors() is null

I hacked an if null, return an empty new class that impl List else return this.customSpreadFactors and that seems to load things fine. Untested if it actually makes a difference however.

Stack trace snippet (repeat for every structure vanilla and modded):

> Errors in registry minecraft:worldgen/structure_set:
>> Errors in element minecraft:ancient_cities:
java.lang.IllegalStateException: Failed to parse minecraft:worldgen/structure_set/ancient_cities.json from pack vanilla
        at net.minecraft.class_7655.method_45122(class_7655.java:179)
        at net.minecraft.class_7655$class_7657.method_45132(class_7655.java:61)
        at net.minecraft.class_7655.method_45120(class_7655.java:98)
        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
        at net.minecraft.class_7655.method_45121(class_7655.java:98)
        at net.minecraft.class_7237.method_45142(class_7237.java:67)
        at net.minecraft.class_7237.method_45143(class_7237.java:71)
        at net.minecraft.class_7237.method_42098(class_7237.java:34)
        at net.minecraft.server.Main.method_43612(Main.java:159)
        at net.minecraft.class_156.method_43498(class_156.java:945)
        at net.minecraft.class_156.method_43499(class_156.java:939)
        at net.minecraft.server.Main.main(Main.java:157)
        at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
        at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
        at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)
        at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because the return value of "io.github.maxencedc.sparsestructures.SparseStructuresConfig.customSpreadFactors()" is null
        at net.minecraft.class_7655.handler$dok000$sparsestructures$load(class_7655.java:1028)
        at net.minecraft.class_7655.method_45122(class_7655.java:175)
        ... 15 more
MaxenceDC commented 8 months ago

This seems like a bad issue, thank you for the report! I will try to reproduce and fix it asap.

PapiOphidian commented 8 months ago

I tried to load the server with my hack and it didn't load, but there were no errors. Granted, there were other mods that messed with world gen, so that may be it but idk.

MaxenceDC commented 6 months ago

Sorry for the late reply, do you happen to have a list of the worldgen mods you were using?

PapiOphidian commented 6 months ago

blossom blade c2me dungeons and taverns dungeons arise explorify incendium nullscape repurposed structures sky villages snow under trees starlight structory + towers terralith