Chunk Loaders

Chunk Loaders

8M Downloads

[Crash] Exception in server tick loop

kaliflowerx3 opened this issue ยท 2 comments

commented

Version Info

  • Minecraft, forge 40.1.73 (1.18.2)
  • Chunk Loaders, 1.2.0c

Are you using OptiFine?:
no

Steps to Reproduce
unclear. happens randomly. it might happen on a player log out?

Crash report (~/logs/latest.log)

Description: Exception in server tick loop

java.lang.NullPointerException: Cannot invoke "java.util.Set.remove(Object)" because "activePlayers" is null
	at com.supermartijn642.chunkloaders.capability.ServerChunkLoadingCapability.togglePlayerActivity(ServerChunkLoadingCapability.java:162) ~[chunkloaders-1.2.0c-forge-mc1.18.jar%2353!/:?] {re:classloading}
	at com.supermartijn642.chunkloaders.capability.PlayerActivityTracker.lambda$onServerTick$1(PlayerActivityTracker.java:88) ~[chunkloaders-1.2.0c-forge-mc1.18.jar%2353!/:?] {re:classloading}
	at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:647) ~[?:?] {}
	at com.supermartijn642.chunkloaders.capability.PlayerActivityTracker.onServerTick(PlayerActivityTracker.java:88) ~[chunkloaders-1.2.0c-forge-mc1.18.jar%2353!/:?] {re:classloading}
	at net.minecraftforge.eventbus.ASMEventHandler_526_PlayerActivityTracker_onServerTick_ServerTickEvent.invoke(.dynamic) ~[?:?] {}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-5.0.3.jar%232!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.3.jar%232!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.3.jar%232!/:?] {}
	at net.minecraftforge.event.ForgeEventFactory.onPreServerTick(ForgeEventFactory.java:926) ~[forge-1.18.2-40.1.73-universal.jar%23109!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:840) ~[server-1.18.2-20220404.173914-srg.jar%23104!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:inject_resources.MinecraftServerMixin,pl:mixin:APP:elementalcraft.mixins.json:MixinMinecraftServer,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:terrablender.mixins.json:MixinMinecraftServer,pl:mixin:APP:flan.mixins.json:MinecraftServerMixin,pl:mixin:A}
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:685) ~[server-1.18.2-20220404.173914-srg.jar%23104!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:inject_resources.MinecraftServerMixin,pl:mixin:APP:elementalcraft.mixins.json:MixinMinecraftServer,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:terrablender.mixins.json:MixinMinecraftServer,pl:mixin:APP:flan.mixins.json:MinecraftServerMixin,pl:mixin:A}
	at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:261) ~[server-1.18.2-20220404.173914-srg.jar%23104!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:inject_resources.MinecraftServerMixin,pl:mixin:APP:elementalcraft.mixins.json:MixinMinecraftServer,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:terrablender.mixins.json:MixinMinecraftServer,pl:mixin:APP:flan.mixins.json:MinecraftServerMixin,pl:mixin:A}
	at java.lang.Thread.run(Thread.java:833) [?:?] {}
commented

Looks like an oversight and should be rather easy to fix. I will probably have a look at it tomorrow.

commented

The crash sometimes occurs when the offline timeout for a player's loaded chunks expires, so indeed, it would probably seem random.
I fixed it now in Chunk Loaders 1.2.1.

Thank you for reporting the issue!