Jannyboy11 / InvSee-plus-plus

A bukkit plugin for manipulating player inventories
Other
90 stars 16 forks source link

Support Folia server software #42

Closed Jannyboy11 closed 1 year ago

Jannyboy11 commented 1 year ago

Folia is server software forked from Paper, which includes extra multithreading optimizations. InvSee++ currently does not work on this server software, as can be seen from the following stack trace:

[00:36:53 ERROR]: Error occurred while enabling InvSeePlusPlus v0.19.8-SNAPSHOT (Is it up to date?)
java.lang.UnsupportedOperationException: null
        at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.handle(CraftScheduler.java:536) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:260) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:247) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskLaterAsynchronously(CraftScheduler.java:192) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskAsynchronously(CraftScheduler.java:161) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at com.janboerman.invsee.paper.AsyncTabCompleter.<init>(AsyncTabCompleter.java:44) ~[InvSee++.jar:?]
        at com.janboerman.invsee.spigot.InvseePlusPlus.onEnable(InvseePlusPlus.java:89) ~[InvSee++.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[folia-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:192) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[folia-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:631) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:542) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:680) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:464) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1190) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:347) ~[folia-1.19.4.jar:git-Folia-"b3e1b06"]
        at java.lang.Thread.run(Thread.java:1623) ~[?:?]

In order to fix this, I will have to carefully reconsider each place where the bukkit scheduler is usued, and use the correct Folia scheduler accordingly. See https://github.com/PaperMC/Folia#current-api-additions and https://github.com/PaperMC/Folia/blob/master/PROJECT_DESCRIPTION.md#global-region.

Edit: Folia documentation now moved to: https://docs.papermc.io/folia/reference/overview.

Jannyboy11 commented 1 year ago

Implemented as of https://github.com/Jannyboy11/InvSee-plus-plus/commit/5447231ed39d1a367b6f122e47d2d2273c344541. Release: http://github.com/Jannyboy11/InvSee-plus-plus/releases/v0.20.0.