Anon8281 / UniversalScheduler

Universal scheduling lib for Folia/Spigot/Bukkit/etc. plugins
MIT License
40 stars 7 forks source link

Add `getTaskId()` and `cancelTask(int)` #3

Closed DreamVoid closed 1 year ago

Clercq commented 1 year ago

This changes doesn't make any sense, because will broke Folia support. The point of library is to make some calls internally in library to make the end developer easier interaction with Folia API.

The UnsupportedOperationException is quite unexpected for any developer.

DreamVoid commented 1 year ago

This changes doesn't make any sense, because will broke Folia support. The point of library is to make some calls internally in library to make the end developer easier interaction with Folia API.

The UnsupportedOperationException is quite unexpected for any developer.

Folia never had a taskId, so how can you say that it broke Folia’s support? Developers who don’t need it won’t use it, and how can you judge whether Folia will add taskId again in the future?

Clercq commented 1 year ago

Folia never had a taskId, so how can you say that it broke Folia’s support? Developers who don’t need it won’t use it, and how can you judge whether Folia will add taskId again in the future?

If you would like to write a plugin that supports latest and old Folia, Paper, Spigot cores, you should get understand that you cannot cancel the task, otherwise Folia realization will work incorrectly.

If you wouldn't like to write the Folia support this library shoudn't be used.

That's the reason why we shoudn't add taskId and cancellation, till Folia starts support it.

That's looks like correct solution for the case, isn't it?

Clercq commented 1 year ago

Of course, if you know how to deal the task cancellation in Folia, we can make some workaround, however, right now commit looks weird

Clercq commented 1 year ago

@Anon8281 could you please have a look, is it possible to cancel the task by calling ScheduledTask.cancel()?