Skip to content
Matej Pacan edited this page Aug 21, 2023 · 2 revisions

To have Folia support using Foundation in your plugin:

  • Never call Bukkit#getScheduler(), because it will throw UnsupportedOperationException in the server.
  • Instead, call the runX methods in our Common class (such as Common.runLater()), which support both Folia and Paper.
  • Replace all BukkitRunnable with our SimpleRunnable.
  • To cancel all tasks, call Common#cancelTasks()
  • To cancel a specific task, keep its copy from Common#runX() and call the cancel() method inside of it.
Clone this wiki locally