[02:59:00] [Server thread/ERROR] [Sponge]: The Scheduler tried to run the task eaglefactions-S-0 owned by Plugin{id=eaglefactions, name=Eagle Factions, version=0.15.2_345-SNAPSHOT, description=A factions plugin that will make managing your battle-server easier. :), authors=[Aquerr], source=D:\desktop\WOG New Era\.\mods\plugins\EagleFactions-0.15.2_345-SNAPSHOT.jar}, but an error occured.
java.lang.NullPointerException: Context object cannot be null
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:787) ~[minecraft_server.1.12.2.jar:?]
at org.spongepowered.api.event.cause.EventContext$Builder.add(EventContext.java:200) ~[EventContext$Builder.class:1.12.2-2838-7.2.3-RC4035]
at io.github.aquerr.eaglefactions.common.events.EventRunner.runFactionDisbandEvent(EventRunner.java:150) ~[EventRunner.class:?]
at io.github.aquerr.eaglefactions.common.scheduling.FactionRemoverTask.run(FactionRemoverTask.java:55) ~[FactionRemoverTask.class:?]
at org.spongepowered.api.scheduler.Task$Builder.lambda$execute$0(Task.java:139) ~[Task$Builder.class:1.12.2-2838-7.2.3-RC4035]
at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$0(SchedulerBase.java:197) ~[SchedulerBase.class:1.12.2-2838-7.2.3-RC4035]
at org.spongepowered.common.scheduler.SyncScheduler.executeTaskRunnable(SyncScheduler.java:74) ~[SyncScheduler.class:1.12.2-2838-7.2.3-RC4035]
at org.spongepowered.common.scheduler.SchedulerBase.startTask(SchedulerBase.java:188) ~[SchedulerBase.class:1.12.2-2838-7.2.3-RC4035]
at org.spongepowered.common.scheduler.SchedulerBase.processTask(SchedulerBase.java:174) ~[SchedulerBase.class:1.12.2-2838-7.2.3-RC4035]
at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(Unknown Source) [?:1.8.0_251]
at org.spongepowered.common.scheduler.SchedulerBase.runTick(SchedulerBase.java:112) [SchedulerBase.class:1.12.2-2838-7.2.3-RC4035]
at org.spongepowered.common.scheduler.SyncScheduler.tick(SyncScheduler.java:47) [SyncScheduler.class:1.12.2-2838-7.2.3-RC4035]
at org.spongepowered.common.scheduler.SpongeScheduler.tickSyncScheduler(SpongeScheduler.java:189) [SpongeScheduler.class:1.12.2-2838-7.2.3-RC4035]
at org.spongepowered.mod.SpongeMod.onTick(SpongeMod.java:457) [SpongeMod.class:1.12.2-2838-7.2.3-RC4035]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_56_SpongeMod_onTick_ServerTickEvent.invoke(.dynamic) [?:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) [ASMEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.EventBus.forgeBridge$post(EventBus.java:756) [EventBus.class:?]
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:706) [EventBus.class:?]
at net.minecraftforge.fml.common.FMLCommonHandler.onPreServerTick(FMLCommonHandler.java:279) [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(Unknown Source) [?:1.8.0_251]
Steps to reroduce
Enable auto-disband
Login with non-primary player
Create some guild as this player
Logout
Wait a little bit
More information
It happened because EventContext does not allow null values as event source.
Environment
Sponge Version: 1.12.2-2838-7.2.3-RC4035
Plugin Version: 0.15.2_345-SNAPSHOT
What happens?
Disband scheduler crushes with error:
Steps to reroduce
More information
It happened because EventContext does not allow null values as event source.
But you call it inside scheduler: https://github.com/Aquerr/EagleFactions/blob/01196a893ce8cbc27aecb1d7a19b0c912805ef1c/common/src/main/java/io/github/aquerr/eaglefactions/common/scheduling/FactionRemoverTask.java#L55 And null passes to @NotNull arguments: https://github.com/Aquerr/EagleFactions/blob/01196a893ce8cbc27aecb1d7a19b0c912805ef1c/common/src/main/java/io/github/aquerr/eaglefactions/common/events/EventRunner.java#L149-L155
Possible fix (but I am not sure)
To fix this problem you may pass Console instead null as disband source.