Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
24 changes: 15 additions & 9 deletions src/main/java/org/popcraft/boltworldguard/BoltWorldGuard.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down