The Lost Cities

The Lost Cities

59M Downloads

LostWorldProvider.java NPE

clienthax opened this issue ยท 9 comments

commented

Seems to of been introduced in ddce0ca
Im guessing the problem is the attempt to access the world provider before its initalised
https://github.com/McJtyMods/LostCities/blob/1.12/src/main/java/mcjty/lostcities/dimensions/world/LostWorldProvider.java#L28
Unsure if sponge or LostCities issue currently

[03:38:09] [Server thread/INFO] [STDERR]: [org.spongepowered.common.world.WorldManager:getWorldFolder:1438]: java.lang.NullPointerException
[03:38:09] [Server thread/INFO] [STDERR]: [org.spongepowered.common.world.WorldManager:getWorldFolder:1438]: 	at mcjty.lostcities.dimensions.world.LostWorldProvider.getSaveFolder(LostWorldProvider.java:28)
[03:38:09] [Server thread/INFO] [STDERR]: [org.spongepowered.common.world.WorldManager:getWorldFolder:1438]: 	at org.spongepowered.common.world.WorldManager.getWorldFolder(WorldManager.java:1434)
[03:38:09] [Server thread/INFO] [STDERR]: [org.spongepowered.common.world.WorldManager:getWorldFolder:1438]: 	at org.spongepowered.common.world.WorldManager.loadAllWorlds(WorldManager.java:674)
[03:38:09] [Server thread/INFO] [STDERR]: [org.spongepowered.common.world.WorldManager:getWorldFolder:1438]: 	at net.minecraft.server.MinecraftServer.func_71247_a(MinecraftServer.java:3541)
[03:38:09] [Server thread/INFO] [STDERR]: [org.spongepowered.common.world.WorldManager:getWorldFolder:1438]: 	at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:270)
[03:38:09] [Server thread/INFO] [STDERR]: [org.spongepowered.common.world.WorldManager:getWorldFolder:1438]: 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486)
[03:38:09] [Server thread/INFO] [STDERR]: [org.spongepowered.common.world.WorldManager:getWorldFolder:1438]: 	at java.lang.Thread.run(Thread.java:748)
commented

This sounds like a sponge issue indeed. At least it works fine without sponge.

commented

Want me to raise it to sponge, or do you want to :p?

commented

Feel free :-)

commented
commented

For the record, a similar issue is visible with meecreeps loading LostCities:

[13:05:49] [Server thread/INFO] [mcjty.lib.varia.Logging]: RFTools: server is starting
[13:05:49] [Server thread/INFO] [mcjty.lib.varia.Logging]: Registering RFTools dimensions:
[13:05:49] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.fml.common.gameevent.TickEvent$ServerTickEvent@75e5a33e:
java.lang.NullPointerException: null
        at mcjty.lostcities.dimensions.world.LostWorldProvider.getSaveFolder(LostWorldProvider.java:28) ~[LostWorldProvider.class:?]
        at net.minecraftforge.common.DimensionManager.initDimension(DimensionManager.java:783) ~[DimensionManager.class:?]
        at net.minecraft.server.MinecraftServer.func_71218_a(MinecraftServer.java:4150) ~[MinecraftServer.class:?]
        at mcjty.lib.varia.TeleportationTools.getWorldForDimension(TeleportationTools.java:48) ~[TeleportationTools.class:?]
        at mcjty.meecreeps.actions.ServerActionManager.findMeeCreep(ServerActionManager.java:234) ~[ServerActionManager.class:?]
        at mcjty.meecreeps.actions.ServerActionManager.tick(ServerActionManager.java:250) ~[ServerActionManager.class:?]
        at mcjty.meecreeps.ForgeEventHandlers.onWorldTick(ForgeEventHandlers.java:33) ~[ForgeEventHandlers.class:?]
        at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_929_ForgeEventHandlers_onWorldTick_ServerTickEvent.invoke(.dynamic) ~[?:?]
        at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
        at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:662) [EventBus.class:?]
        at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:597) [EventBus.class:?]
        at net.minecraftforge.fml.common.FMLCommonHandler.onPreServerTick(FMLCommonHandler.java:278) [FMLCommonHandler.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:657) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
commented

@gabizou Is that a Sponge problem? Only mentioned because LemADEC did.

commented

Same with meecreeps here McJtyMods/MeeCreeps#44

commented

@McJty
https://github.com/McJtyMods/LostCities/blob/1.12/src/main/java/mcjty/lostcities/dimensions/world/LostWorldProvider.java#L28

This should be changed to

    public String getSaveFolder() {
        if (this.dimensionId == LostCityConfiguration.DIMENSION_ID) {
            return "LOST";
        } else {
            return "LOST" + this.dimensionId;
        }
    }

This will solve the issue where getSaveFolder is called before the world is set.

commented

@Shybella It's not the same issue. Different exception for different reasons.