Commit Graph

17 Commits

Author SHA1 Message Date
Owen1212055
32f79c415e Support paper plugin meta marking plugins as Folia supported 2023-03-29 14:12:30 -07:00
Josh Roy
88167d59d2
Add Server#isGlobalTickThread (#5) 2023-03-28 18:59:19 -07:00
Josh Roy
5fa0556869
Use longs for scheduler delays/periods (#4) 2023-03-25 21:48:28 -07:00
Spottedleaf
75e3cdbc61 Rebase fixups 2023-03-25 16:29:07 -07:00
Spottedleaf
6df8272abf Deprecate bukkit scheduler
Every method on that should basically throw, so the API should
reflect that
2023-03-25 16:27:55 -07:00
Nassim Jahnke
836dc75b65
Replace Vector with Position in isOwnedByCurrentRegion methods
Closes #3
2023-03-25 18:50:36 +01:00
Nassim Jahnke
8d15f3e23d
Add methods taking world, chunkX, chunkZ to RegionScheduler 2023-03-25 18:40:20 +01:00
Nassim Jahnke
dfc157075a
Renames for consistency 2023-03-25 00:22:47 +01:00
Spottedleaf
c7fbdd87d2 Update to 1.19.4
Patches applied, but not yet checked compile.
2023-03-23 06:55:09 -07:00
Spottedleaf
50ad6c3131 New scheduler API
Now, entity/global/location schedulers implement a generic run,
runDelayed, and runAtFixedRate methods that provide a ScheduledTask
value that can be used to interact with the scheduled task.

Add also an async task scheduler that implements the same methods,
except the delays/periods are in time and not ticks, as the scheduler
is independent of the server tick process.

Additionally, throw on some unimplemented APIs now.
2023-03-23 02:51:04 -07:00
Spottedleaf
7e948a6179 Add global region scheduler
This will allow plugins to safely execute commands or perform
other global tick thread data modification.
2023-03-19 16:43:34 -07:00
Spottedleaf
68b20e0acc Add API for checking ownership of region by position/entity
This may be useful for plugins which want to perform operations
over large areas outside of the buffer zone provided by the
regionaliser, as it is not guaranteed that anything outside
of the buffer zone is owned. Then, the plugins may use
the schedulers depending on the result of the ownership
check.
2023-03-07 14:44:37 -08:00
Spottedleaf
2ccfc8efc0 Add RegionisedServerInitEvent
This event allows plugins to perform synchronous operations before
any region will tick. Plugins will not have to worry about the
possibility of a region ticking in parallel while listening
to the event.
2023-03-07 13:06:11 -08:00
Spottedleaf
5c4d65efb8 Require plugins to be explicitly marked as Folia supported
Plugins must add "folia-supported: true" to their plugin.yml
otherwise the server will refuse to load them.

Since Folia is a major breakage for plugins, the vast majority
of plugins will not function correctly on Folia. To prevent
user confusion from this, we will refuse to load the plugin
and provide a log indicating why - which will be much
more helpful than some random error log caused by
a breakage.
2023-03-06 14:03:17 -08:00
Spottedleaf
4e7205d401 Change entity scheduler API to use Runnables
The generics pose a problem, and the parameter passed to the
Consumer is not needed in API.

Additionally, stop trying to cancel Bukkit scheduler tasks on
plugin disable as the Bukkit scheduler does not work.
2023-03-06 12:57:29 -08:00
Spottedleaf
282ded3b44 Add some scheduling API 2023-03-04 13:13:23 -08:00
Spottedleaf
f7e2fe2267 Force disable timings
Need a new profiler system with region threading
2023-02-23 20:13:44 -08:00