BentoBoxWorld / InvSwitcher

World inventory switcher. Handles health, exp, advancements, inventory, etc.
Eclipse Public License 2.0
2 stars 5 forks source link

Async save #32

Closed tastybento closed 2 months ago

tastybento commented 2 months ago

Expected behavior

Save on shutshown

Observed/Actual behavior

[16:35:22 INFO]: [BentoBox] Disabling InvSwitcher...
[16:35:22 ERROR]: [BentoBox] Error occurred when disabling addon InvSwitcher
[16:35:22 ERROR]: [BentoBox] Report this to the addon's author(s)
[16:35:22 ERROR]: [BentoBox] tastybento
[16:35:22 ERROR]: [BentoBox] org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register task while disabled
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.validate(CraftScheduler.java:539)
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:243)
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:239)
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskLaterAsynchronously(CraftScheduler.java:190)
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskAsynchronously(CraftScheduler.java:159)
    at com.wasteofplastic.invswitcher.Store.saveStats(Store.java:262)
    at com.wasteofplastic.invswitcher.Store.storeAndSave(Store.java:252)
    at com.wasteofplastic.invswitcher.Store.lambda$saveOnlinePlayers$24(Store.java:465)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1116)
    at com.wasteofplastic.invswitcher.Store.saveOnlinePlayers(Store.java:465)
    at com.wasteofplastic.invswitcher.InvSwitcher.onDisable(InvSwitcher.java:93)
    at BentoBox-2.5.4-SNAPSHOT-LOCAL.jar//world.bentobox.bentobox.managers.AddonsManager.disable(AddonsManager.java:694)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
    at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
    at BentoBox-2.5.4-SNAPSHOT-LOCAL.jar//world.bentobox.bentobox.managers.AddonsManager.disableAddons(AddonsManager.java:479)
    at BentoBox-2.5.4-SNAPSHOT-LOCAL.jar//world.bentobox.bentobox.BentoBox.onDisable(BentoBox.java:330)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:291)
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugin(PaperPluginInstanceManager.java:237)
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugins(PaperPluginInstanceManager.java:161)
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.disablePlugins(PaperPluginManagerImpl.java:97)
    at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:541)
    at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:609)
    at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:1046)
    at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:847)
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1353)
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:330)
    at java.base/java.lang.Thread.run(Thread.java:1583)

Steps/models to reproduce

Use InvSwitcher-1.14.0

BentoBox version

2.5.2

Plugin list

No response

Other

No response