FTBTeam / FTB-Mods-Issues

Any mod issues, be it FTB Teams, Quests or any other of our mods can be reported here!
21 stars 1 forks source link

NPE when force loading chunks in mining dimension after server restart (FTB Rev 3.5.0) #7

Open Technoguyfication opened 3 years ago

Technoguyfication commented 3 years ago

I'm running a FTB Revelation 3.5.0 server with ftbutilities.chunkloader.load_offline set to false for players (so their force loaded chunks are only loaded whilst they are online). After a fresh server restart, if a player logs in in the overworld and has chunks loaded in aroma1997's mining dimension, the chunks will fail to load. This continues every 60 seconds when the chunk loader refreshes until a player visits the mining dimension through the portal (or logs in while in the mining dim).

Error stacktrace:

[05:32:57] [Server thread/ERROR] [FTB Utilities]: Failed to force chunk 56,27 in MINING_WORLD from gamers: java.lang.NullPointerException
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]: java.lang.NullPointerException
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at com.google.common.collect.ImmutableSetMultimap$Builder.putAll(ImmutableSetMultimap.java:317)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at net.minecraftforge.common.ForgeChunkManager.forceChunk(ForgeChunkManager.java:820)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager.forceChunk(FTBUtilitiesLoadedChunkManager.java:116)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at com.feed_the_beast.ftbutilities.data.ClaimedChunks.update(ClaimedChunks.java:136)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at com.feed_the_beast.ftbutilities.handlers.FTBUtilitiesServerEventHandler.onServerTick(FTBUtilitiesServerEventHandler.java:171)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_614_FTBUtilitiesServerEventHandler_onServerTick_ServerTickEvent.invoke(.dynamic)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at net.minecraftforge.fml.common.FMLCommonHandler.onPreServerTick(FMLCommonHandler.java:279)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:657)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
[05:32:57] [Server thread/INFO] [STDERR]: [com.feed_the_beast.ftbutilities.data.FTBUtilitiesLoadedChunkManager:forceChunk:137]:         at java.lang.Thread.run(Thread.java:748)

To reproduce:

  1. Create a fresh server and disable offline chunk loading with /ranks set_permission player ftbutilities.chunkloader.load_offline false
  2. Visit the mining dimension and claim / load some chunks
  3. Leave the mining dimension and log out
  4. Restart the server
  5. Upon logging back in, the above error will be printed to console and the mining dimension chunks will NOT be loaded until you visit the mining dimension manually

Expected behavior:

  1. Steps 1-4 from above
  2. Upon logging back in, the chunks in the mining dimension will be force loaded regardless of whether or not any players have visited it yet
ThePixelbrain commented 1 year ago

This is fixed in my PR (https://github.com/FTBTeam/FTB-Utilities/pull/1159) but sadly it never got merged.