Latest version of WorldGuard is not Folia supported.

Open
#2,333 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
backend, devtools

Research direction

Start with BukkitRegionContainer.initialize at the reported BukkitRegionContainer.java:107 call to scheduleSyncRepeatingTask, then trace how WorldGuard schedules its repeating task and check Folia's region scheduling APIs. Reproduce startup on Folia or Canvas and identify a compatible scheduling path; done when WorldGuard initializes without the reported unsupported-operation error and its repeating task behaves correctly.

Written by the indexing model from the issue text.

Description

status:invalid type:bug
WorldEdit Version

FAWE (please ignore the checkbox since the issue is not related to FAWE)

WorldGuard Version

WorldGuard (7.0.21+2424-da30a99)

Platform Version

Canvas 26.3-990

Confirmations
  • I am using the most recent Minecraft release.
  • I am using a version of WorldEdit compatible with my Minecraft version.
  • I am using a version of WorldGuard compatible with my Minecraft version.
  • I am using the latest or recommended version of my platform software.
  • I am NOT using a hybrid server, e.g. a server that combines Bukkit and Forge. Examples include Arclight, Mohist, and Cardboard.
  • I am NOT using a fork of WorldEdit, such as FastAsyncWorldEdit (FAWE) or AsyncWorldEdit (AWE)
Bug Description

The latest version of WorldGuard is not supported on Folia/CanvasMC, however on Modrinth it is clearly stated that it is Folia friendly.
WorldGuard is attempting to register a global repeating sync task via the standard Bukkit CraftScheduler.runTaskTimer during initialization (BukkitRegionContainer.initialize), and Folia doesn't support that.
The previous plugin version worked perfectly fine.

[21:39:58 ERROR]: Error occurred while enabling WorldGuard v7.0.21+2424-da30a99 (Is it up to date?)
java.lang.UnsupportedOperationException: Unsupported in region threading
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.handle(CraftScheduler.java:517) ~[canvas-26.3.jar:26.3-990-9a31333]
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:227) ~[canvas-26.3.jar:26.3-990-9a31333]
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:209) ~[canvas-26.3.jar:26.3-990-9a31333]
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.scheduleSyncRepeatingTask(CraftScheduler.java:204) ~[canvas-26.3.jar:26.3-990-9a31333]
        at worldguard-bukkit-7.0.21.jar//com.sk89q.worldguard.bukkit.BukkitRegionContainer.initialize(BukkitRegionContainer.java:107) ~[?:?]
        at worldguard-bukkit-7.0.21.jar//com.sk89q.worldguard.bukkit.BukkitWorldGuardPlatform.load(BukkitWorldGuardPlatform.java:143) ~[?:?]
        at worldguard-bukkit-7.0.21.jar//com.sk89q.worldguard.WorldGuard.setup(WorldGuard.java:91) ~[?:?]
        at worldguard-bukkit-7.0.21.jar//com.sk89q.worldguard.bukkit.WorldGuardPlugin.onEnable(WorldGuardPlugin.java:158) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:280) ~[canvas-api-26.3.build.990-stable.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:201) ~[canvas-26.3.jar:26.3-990-9a31333]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[canvas-26.3.jar:26.3-990-9a31333]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:519) ~[canvas-api-26.3.build.944-alpha.jar:?]
        at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:626) ~[canvas-26.3.jar:26.3-990-9a31333]
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:583) ~[canvas-26.3.jar:26.3-990-9a31333]
        at net.minecraft.server.MinecraftServer.initPostWorld(MinecraftServer.java:648) ~[canvas-26.3.jar:26.3-990-9a31333]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:357) ~[canvas-26.3.jar:26.3-990-9a31333]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1266) ~[canvas-26.3.jar:26.3-990-9a31333]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:291) ~[canvas-26.3.jar:26.3-990-9a31333]
        at java.base/java.lang.Thread.run(Thread.java:1474) ~[?:?]
Expected Behavior

WorldGuard should natively check for a multi-threaded (Folia/Canvas) environment and appropriately handle or bypass global repeating tasks during initialization, or provide explicit compatibility with Folia's asynchronous/region scheduling APIs.

Reproduction Steps
  1. Start up a Folia server with WorldGuard
  2. Wait for plugin startup
Optional WorldGuard-Report

No response

Anything Else?

No response

Dominant language
Java
Stars
944
Forks
686
Avg merge
4d 7h
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EngineHub/WorldGuard

All issues in EngineHub/WorldGuard

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.