Magic

Magic

190k Downloads

Error on startup from Citizens NPC

mibby opened this issue ยท 4 comments

commented

@NathanWolf Getting this error for every citizens NPC I have during server start-up with Magic dev 2493.

[01:45:03] [Server thread/WARN]: [Magic] Player data for fa53e359-5877-232b-ab6d-bfb07e744070 (Maintenance) loaded while offline!
[01:45:03] [Server thread/WARN]: java.lang.Exception: Stack trace
[01:45:03] [Server thread/WARN]: 	at java.lang.Thread.dumpStack(Thread.java:1336)
[01:45:03] [Server thread/WARN]: 	at com.elmakers.mine.bukkit.magic.MagicController.getMage(MagicController.java:326)
[01:45:03] [Server thread/WARN]: 	at com.elmakers.mine.bukkit.magic.MagicController.getMage(MagicController.java:254)
[01:45:03] [Server thread/WARN]: 	at com.elmakers.mine.bukkit.magic.MagicController.getMageFromEntity(MagicController.java:226)
[01:45:03] [Server thread/WARN]: 	at com.elmakers.mine.bukkit.magic.MagicController.getMage(MagicController.java:262)
[01:45:03] [Server thread/WARN]: 	at com.elmakers.mine.bukkit.magic.listener.PlayerController.onPlayerTeleport(PlayerController.java:609)
[01:45:03] [Server thread/WARN]: 	at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor976.execute(Unknown Source)
[01:45:03] [Server thread/WARN]: 	at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:70)
[01:45:03] [Server thread/WARN]: 	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78)
[01:45:03] [Server thread/WARN]: 	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[01:45:03] [Server thread/WARN]: 	at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:515)
[01:45:03] [Server thread/WARN]: 	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:500)
[01:45:03] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer.teleport(CraftPlayer.java:623)
[01:45:03] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity.teleport(CraftEntity.java:303)
[01:45:03] [Server thread/WARN]: 	at net.citizensnpcs.npc.CitizensNPC.spawn(CitizensNPC.java:212)
[01:45:03] [Server thread/WARN]: 	at net.citizensnpcs.npc.CitizensNPC.load(CitizensNPC.java:142)
[01:45:03] [Server thread/WARN]: 	at net.citizensnpcs.api.npc.SimpleNPCDataStore.loadInto(SimpleNPCDataStore.java:59)
[01:45:03] [Server thread/WARN]: 	at net.citizensnpcs.Citizens$2.run(Citizens.java:305)
[01:45:03] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:63)
[01:45:03] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:415)
[01:45:03] [Server thread/WARN]: 	at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:833)
[01:45:03] [Server thread/WARN]: 	at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:426)
[01:45:03] [Server thread/WARN]: 	at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:767)
[01:45:03] [Server thread/WARN]: 	at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:665)
[01:45:03] [Server thread/WARN]: 	at java.lang.Thread.run(Thread.java:748)
commented

Oh, hm ... it looks like I have a chicken+egg load order issue, though I'm not sure how I haven't run into this yet on my dev server.

I could see how this happens though- if Citizens moves its NPCs into place before Magic has initialized, then Magic can't tell that the NPCs are NPCs because it hasn't yet integrated with Citizens.

This changed recently, I stopped using metadata to detect NPCs because it is inefficient, and now ask the Citizens plugin directly (Which also lets me differentiate between Sentinel and other non-static NPCs).

But it seems like this actually happens in a task, which implies Magic would've loaded.. hmm... do you happen to have

enable_citizens: false

In Magic's config.yml?

commented

No rush but.. I am eager to know what's wrong here. I did push a fix if the problem was enable_citizens: false, but if you didn't have that in your settings then something else is wrong and I'd love to figure it out.

commented

Going to assume this was fixed, please re-open if not.

commented

Apologies for the late reply. I no longer see the error with dev build 2553 so I assume you fixed it. Thanks. :)