Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folia support #426

Open
BlackBaroness opened this issue Sep 8, 2024 · 5 comments
Open

Folia support #426

BlackBaroness opened this issue Sep 8, 2024 · 5 comments
Labels
feature hacktoberfest This year we’re celebrating 11 years of open source love! https://hacktoberfest.com/ platform

Comments

@BlackBaroness
Copy link
Contributor

Looks like the bukkit module uses the default BukkitScheduler to make async calls. Can we somehow adapt it so it will use Folia scheduler instead of that, when applicable?

Or, what could be even better, can we add a custom async call provider support? Like if I want to use Kotlin coroutines pool?

I'm not sure how to do this in the style of the project, so I open the issue instead of the PR.

@Rollczi
Copy link
Owner

Rollczi commented Sep 8, 2024

Looks like the bukkit module uses the default BukkitScheduler to make async calls. Can we somehow adapt it so it will use Folia scheduler instead of that, when applicable?

Or, what could be even better, can we add a custom async call provider support? Like if I want to use Kotlin coroutines pool?

I'm not sure how to do this in the style of the project, so I open the issue instead of the PR.

Folia work with LiteCommands I guess...
If do you want use Kotlin coroutines then you should implement Scheduler

@Rollczi Rollczi added the question Further information is requested label Sep 8, 2024
@vLuckyyy
Copy link
Collaborator

vLuckyyy commented Sep 8, 2024

Yesterday I tested a plugin to which I added folia support, it uses 100% litecommands, and everything worked fine, did you test it?

@BlackBaroness
Copy link
Contributor Author

Yesterday I tested a plugin to which I added folia support, it uses 100% litecommands, and everything worked fine, did you test it?

I tested it before 3.5.0 release (it shouldn't fix that) and the @Async annotation is incompatible. Other functions are ok

@Rollczi
Copy link
Owner

Rollczi commented Sep 8, 2024

Yesterday I tested a plugin to which I added folia support, it uses 100% litecommands, and everything worked fine, did you test it?

I tested it before 3.5.0 release (it shouldn't fix that) and the @Async annotation is incompatible. Other functions are ok

Fix what? and what is incompatible?

@vLuckyyy
Copy link
Collaborator

vLuckyyy commented Sep 9, 2024

Yesterday I tested a plugin to which I added folia support, it uses 100% litecommands, and everything worked fine, did you test it?

I tested it before 3.5.0 release (it shouldn't fix that) and the @Async annotation is incompatible. Other functions are ok

You are right, commands that use the @Async annotation do not work

[00:47:29 WARN]: java.lang.UnsupportedOperationException
[00:47:29 WARN]:        at org.bukkit.craftbukkit.scheduler.CraftScheduler.handle(CraftScheduler.java:535)
[00:47:29 WARN]:        at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:259)
[00:47:29 WARN]:        at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:246)
[00:47:29 WARN]:        at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskLaterAsynchronously(CraftScheduler.java:191)
[00:47:29 WARN]:        at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskAsynchronously(CraftScheduler.java:160)
[00:47:29 WARN]:        at EternalCore v1.3.4 (MC 1.17.x-1.21.x).jar//com.eternalcode.core.libs.dev.rollczi.litecommands.bukkit.BukkitSchedulerImpl.supplyAsync(BukkitSchedulerImpl.java:63)
[00:47:29 WARN]:        at EternalCore v1.3.4 (MC 1.17.x-1.21.x).jar//com.eternalcode.core.libs.dev.rollczi.litecommands.bukkit.BukkitSchedulerImpl.supplyLater(BukkitSchedulerImpl.java:32)
[00:47:29 WARN]:        at EternalCore v1.3.4 (MC 1.17.x-1.21.x).jar//com.eternalcode.core.libs.dev.rollczi.litecommands.scheduler.Scheduler.supply(Scheduler.java:52)
[00:47:29 WARN]:        at EternalCore v1.3.4 (MC 1.17.x-1.21.x).jar//com.eternalcode.core.libs.dev.rollczi.litecommands.command.executor.CommandExecuteService.lambda$execute$4(CommandExecuteService.java:177)
[00:47:29 WARN]:        at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
[00:47:29 WARN]:        at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2341)
[00:47:29 WARN]:        at EternalCore v1.3.4 (MC 1.17.x-1.21.x).jar//com.eternalcode.core.libs.dev.rollczi.litecommands.command.executor.CommandExecuteService.execute(CommandExecuteService.java:152)
[00:47:29 WARN]:        at EternalCore v1.3.4 (MC 1.17.x-1.21.x).jar//com.eternalcode.core.libs.dev.rollczi.litecommands.command.executor.CommandExecuteService.execute0(CommandExecuteService.java:122)
[00:47:29 WARN]:        at EternalCore v1.3.4 (MC 1.17.x-1.21.x).jar//com.eternalcode.core.libs.dev.rollczi.litecommands.command.executor.CommandExecuteService.execute(CommandExecuteService.java:62)
[00:47:29 WARN]:        at EternalCore v1.3.4 (MC 1.17.x-1.21.x).jar//com.eternalcode.core.libs.dev.rollczi.litecommands.command.CommandManager$PlatformListener.execute(CommandManager.java:63)
[00:47:29 WARN]:        at EternalCore v1.3.4 (MC 1.17.x-1.21.x).jar//com.eternalcode.core.libs.dev.rollczi.litecommands.bukkit.BukkitCommand.execute(BukkitCommand.java:50)
[00:47:29 WARN]:        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:165)
[00:47:29 WARN]:        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1029)
[00:47:29 WARN]:        at org.bukkit.craftbukkit.CraftServer.dispatchServerCommand(CraftServer.java:980)
[00:47:29 WARN]:        at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:521)
[00:47:29 WARN]:        at io.papermc.paper.threadedregions.RegionizedServer.globalTick(RegionizedServer.java:296)
[00:47:29 WARN]:        at io.papermc.paper.threadedregions.RegionizedServer$GlobalTickTickHandle.tickRegion(RegionizedServer.java:148)
[00:47:29 WARN]:        at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:404)
[00:47:29 WARN]:        at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:525)
[00:47:29 WARN]:        at java.base/java.lang.Thread.run(Thread.java:1583)

@Rollczi Rollczi added feature hacktoberfest This year we’re celebrating 11 years of open source love! https://hacktoberfest.com/ platform and removed question Further information is requested labels Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature hacktoberfest This year we’re celebrating 11 years of open source love! https://hacktoberfest.com/ platform
Projects
Status: Todo
Development

No branches or pull requests

3 participants