aikar / commands

Java Command Dispatch Framework - (Bukkit, Spigot, Paper, Sponge, Bungee, JDA, Velocity supported, generically usable anywhere)
https://acfspigot.emc.gs
MIT License
552 stars 144 forks source link

Add support to Folia if it possible #386

Closed Aitooor closed 1 year ago

Aitooor commented 1 year ago

Folia url: https://github.com/PaperMC/Folia

Thanks 😄

chickeneer commented 1 year ago

Have you tried using this in a Folia plugin? I guess, I don't immediately know what is incompatible. Feel free to report particular issues that need addressed.

creatorfromhell commented 1 year ago

Have you tried using this in a Folia plugin? I guess, I don't immediately know what is incompatible. Feel free to report particular issues that need addressed.

I have tested it and here is the resulting error log related to ACF:

java.lang.UnsupportedOperationException: null
    at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.handle(CraftScheduler.java:536) ~[folia-1.19.4.jar:git-Folia-"7072994"]
    at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:236) ~[folia-1.19.4.jar:git-Folia-"7072994"]
    at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:212) ~[folia-1.19.4.jar:git-Folia-"7072994"]
    at net.tnemc.libs.acf.BukkitCommandManager.<init>(BukkitCommandManager.java:125) ~[Folia-0.1.2.0-PRE-1.jar:?]
    at net.tnemc.libs.acf.PaperCommandManager.<init>(PaperCommandManager.java:35) ~[Folia-0.1.2.0-PRE-1.jar:?]

Folia seems to have gotten rid of the handle(CraftTask, delay) method.

I've started some work on getting it running on Folia already so I'll keep this updated with progress.

MiniDigger commented 1 year ago

cant use the bukkit scheduler on folia, should prolly just allow disabling it I guess https://github.com/aikar/commands/blob/master/bukkit/src/main/java/co/aikar/commands/BukkitCommandManager.java#L125

creatorfromhell commented 1 year ago

cant use the bukkit scheduler on folia, should prolly just allow disabling it I guess https://github.com/aikar/commands/blob/master/bukkit/src/main/java/co/aikar/commands/BukkitCommandManager.java#L125

It's also in the ACFBukkitListener too.

chickeneer commented 1 year ago

Alright. I will take a look at the best way to add folia support. Would prefer not to create an extra module for it, but that may very well end up being the route that is needed. Probably extending the paper module and overriding the things that are breaking.

creatorfromhell commented 1 year ago

Alright. I will take a look at the best way to add folia support. Would prefer not to create an extra module for it, but that may very well end up being the route that is needed. Probably extending the paper module and overriding the things that are breaking.

If you're interested in taking a look at a PR I'm about to make for it after testing I'll have it ready shortly.

chickeneer commented 1 year ago

For sure. As long as you don't have anything too crazy in it, I am on board with taking a PR.

creatorfromhell commented 1 year ago

For sure. As long as you don't have anything too crazy in it, I am on board with taking a PR.

I'll try my best not to do anything too outlandish.

creatorfromhell commented 1 year ago

For sure. As long as you don't have anything too crazy in it, I am on board with taking a PR.

I made a PR for it #387 .