Magic

Magic

190k Downloads

Error when disabling magic

killme opened this issue ยท 4 comments

commented

Not sure if this is still possible in the latest snapshots.
Caused an inventory wipe for some of the players.
Not sure what the best way to resolve this would be.

[20:42:51] [Server thread/ERROR]: Error occurred while disabling Magic v6.8-SNAPSHOT (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register task while disabled
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.validate(CraftScheduler.java:407) ~[paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:126) ~[paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.scheduleSyncRepeatingTask(CraftScheduler.java:122) ~[paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.scheduleSyncDelayedTask(CraftScheduler.java:105) ~[paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at com.elmakers.mine.bukkit.action.builtin.CustomProjectileAction.finishEffects(CustomProjectileAction.java:837) ~[?:?]
        at com.elmakers.mine.bukkit.action.builtin.CustomProjectileAction.finish(CustomProjectileAction.java:149) ~[?:?]
        at com.elmakers.mine.bukkit.action.ActionContext.finish(ActionContext.java:70) ~[?:?]
        at com.elmakers.mine.bukkit.action.ActionHandler.finish(ActionHandler.java:296) ~[?:?]
        at com.elmakers.mine.bukkit.batch.ActionBatch.finish(ActionBatch.java:52) ~[?:?]
        at com.elmakers.mine.bukkit.magic.Mage.cancelPending(Mage.java:1287) ~[?:?]
        at com.elmakers.mine.bukkit.magic.Mage.cancelPending(Mage.java:1229) ~[?:?]
        at com.elmakers.mine.bukkit.magic.Mage.deactivateAllSpells(Mage.java:1393) ~[?:?]
        at com.elmakers.mine.bukkit.magic.Mage.deactivate(Mage.java:2559) ~[?:?]
        at com.elmakers.mine.bukkit.magic.MagicController.mageQuit(MagicController.java:2685) ~[?:?]
        at com.elmakers.mine.bukkit.magic.MagicController.playerQuit(MagicController.java:2728) ~[?:?]
        at com.elmakers.mine.bukkit.magic.MagicController.playerQuit(MagicController.java:2679) ~[?:?]
        at com.elmakers.mine.bukkit.magic.MagicController.clear(MagicController.java:2492) ~[?:?]
        at com.elmakers.mine.bukkit.magic.MagicPlugin.onDisable(MagicPlugin.java:239) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:294) ~[paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:347) [paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:427) [paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:420) [paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at org.bukkit.craftbukkit.v1_9_R1.CraftServer.disablePlugins(CraftServer.java:336) [paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at net.minecraft.server.v1_9_R1.MinecraftServer.stop(MinecraftServer.java:456) [paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:656) [paper-1.9.2.jar:git-Paper-"c4f7aa7"]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
commented

Going to close this and assume the linked commit fixed it. Please let me know if you've seen it again, though.

commented

I do believe I fixed this specific exception a while back.

Sucks that it caused inventory issues though- there might be some exception catching that should be added on shutdown to prevent this, in case some other specific error comes up down the road.

commented

This is the commit that fixed the exception: 7488f8d

commented

The weird thing, though, is it would seem that the order of events here is correct- the wand should've been deactivated already, which would've restored the player's inventory- so I'm not sure what happened there:

    public void deactivate() {
        deactivateWand();
        deactivateAllSpells(true, true);
        removeActiveEffects();
    }