Skip to content

Platform compatibility

Cyrusbye720 edited this page Jun 6, 2026 · 3 revisions

Platform compatibility

ZDiscord supports Paper, Folia, and Spigot through a PlatformAdapter abstraction. The platform is detected at startup by classpath probing:

  1. If io.papermc.paper.threadedregions.RegionizedServer is present → Folia
  2. Else if io.papermc.paper.event.player.AsyncChatEvent is present → Paper
  3. Else → Spigot

Scheduling

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.

Folia caveats

  • 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's cancelTasks.

Spigot caveats

  • Bukkit.getTPS() is not available. ZDiscord probes for it at startup and falls back to a constant 20.0 for the /tps command and the performance embed.
  • The Paper-only AsyncChatEvent is not used; ZDiscord subscribes to AsyncPlayerChatEvent instead, which is available in both Paper and Spigot.

ZDiscord v1.1.0 · Home · Issues · Source

Clone this wiki locally