-
Notifications
You must be signed in to change notification settings - Fork 1
Platform compatibility
Cyrusbye720 edited this page Jun 6, 2026
·
3 revisions
ZDiscord supports Paper, Folia, and Spigot through a PlatformAdapter abstraction. The platform is detected at startup by classpath probing:
- If
io.papermc.paper.threadedregions.RegionizedServeris present → Folia - Else if
io.papermc.paper.event.player.AsyncChatEventis present → Paper - Else → Spigot
The adapter provides runAsync, runSync, runForEntity, runLater, runTimer, and runAsyncTimer methods.
On Folia, the adapter uses the region-aware schedulers via reflection so the plugin can be compiled against a non-Folia Paper API and still load on a Folia server.
On Paper and Spigot, the adapter delegates to the standard BukkitScheduler.
- Region-aware scheduling is used wherever a player or entity is involved. For server-wide operations (broadcasts, console streaming) the global scheduler is used.
- Tasks are cancelled in
cancelAllTasks()on plugin disable, which calls the global scheduler'scancelTasks.
-
Bukkit.getTPS()is not available. ZDiscord probes for it at startup and falls back to a constant20.0for the/tpscommand and the performance embed. - The Paper-only
AsyncChatEventis not used; ZDiscord subscribes toAsyncPlayerChatEventinstead, which is available in both Paper and Spigot.