From 4594ec5ba31ca2af05de2569308398e5f42c7187 Mon Sep 17 00:00:00 2001 From: Jsinco Date: Tue, 3 Feb 2026 04:19:01 -0500 Subject: [PATCH 1/2] folia --- src/main/resources/plugin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index a9d17a8..a40db83 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -3,6 +3,7 @@ version: '${version}' main: org.popcraft.boltworldguard.BoltWorldGuard api-version: 1.19 depend: [ Bolt, WorldGuard ] +folia-supported: true commands: protectregion: description: Protect in a region From 5dcb88a46d566471ea442c68d31952fe0a7c2ecc Mon Sep 17 00:00:00 2001 From: Jsinco Date: Fri, 6 Feb 2026 20:29:39 -0500 Subject: [PATCH 2/2] fix(folia): schedule getBlockAt --- build.gradle | 6 ++--- .../boltworldguard/BoltWorldGuard.java | 24 ++++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 3481d49..b1fdf6a 100644 --- a/build.gradle +++ b/build.gradle @@ -9,8 +9,8 @@ version = '1.0.3' repositories { mavenCentral() maven { - name = "spigotmc-repo" - url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" + name = "papermc-repo" + url = "https://repo.papermc.io/repository/maven-public/" } maven { name = "sonatype" @@ -27,7 +27,7 @@ repositories { } dependencies { - compileOnly "org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT" + compileOnly "io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT" compileOnly "org.popcraft:bolt-common:1.0.575" compileOnly "org.popcraft:bolt-bukkit:1.0.575" compileOnly "com.sk89q.worldguard:worldguard-bukkit:7.0.7" diff --git a/src/main/java/org/popcraft/boltworldguard/BoltWorldGuard.java b/src/main/java/org/popcraft/boltworldguard/BoltWorldGuard.java index cbc5ca1..9b58761 100644 --- a/src/main/java/org/popcraft/boltworldguard/BoltWorldGuard.java +++ b/src/main/java/org/popcraft/boltworldguard/BoltWorldGuard.java @@ -223,15 +223,21 @@ public boolean onCommand(CommandSender sender, Command command, String label, St for (int x = minBlockX; x <= maxBlockX; x++) { for (int y = minBlockY; y <= maxBlockY; y++) { for (int z = minBlockZ; z <= maxBlockZ; z++) { - final Block block = bukkitWorld.getBlockAt(x, y, z); - if (!bolt.isProtectable(block) || bolt.isProtected(block)) { - continue; - } - if (material != null && !material.equals(block.getType())) { - continue; - } - final BlockProtection blockProtection = bolt.createProtection(block, protectOwner, protectType); - bolt.saveProtection(blockProtection); + final Material finalMaterial = material; + final int finalX = x; + final int finalY = y; + final int finalZ = z; + Bukkit.getRegionScheduler().execute(this, bukkitWorld, x >> 4, z >> 4, () -> { + final Block block = bukkitWorld.getBlockAt(finalX, finalY, finalZ); + if (!bolt.isProtectable(block) || bolt.isProtected(block)) { + return; + } + if (finalMaterial != null && !finalMaterial.equals(block.getType())) { + return; + } + final BlockProtection blockProtection = bolt.createProtection(block, protectOwner, protectType); + bolt.saveProtection(blockProtection); + }); } } }