diff --git a/.gitignore b/.gitignore index df58940..fd37327 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ build/ .gradle/ */.gradle/ !gradle/*/*.jar +.vscode/* diff --git a/BlueBridgeCore/build.gradle b/BlueBridgeCore/build.gradle index eb735f7..333e363 100644 --- a/BlueBridgeCore/build.gradle +++ b/BlueBridgeCore/build.gradle @@ -5,20 +5,19 @@ buildscript { } } dependencies { - classpath "com.github.jengelman.gradle.plugins:shadow:6.0.0" + classpath 'com.gradleup.shadow:shadow-gradle-plugin:8.3.0' } } -plugins { - id "com.github.johnrengelman.shadow" version "6.0.0" -} +apply plugin: 'com.gradleup.shadow' dependencies { - provided 'com.github.BlueMap-Minecraft:BlueMapAPI:2.5.0' + compileOnly 'de.bluecolored.bluemap:BlueMapAPI:2.7.2' // https://mvnrepository.com/artifact/org.apache.commons/commons-text implementation 'org.apache.commons:commons-text:1.9' + compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT") } tasks.build.dependsOn tasks.shadowJar diff --git a/BlueBridgeCore/src/main/java/de/mark225/bluebridge/core/bluemap/BlueMapIntegration.java b/BlueBridgeCore/src/main/java/de/mark225/bluebridge/core/bluemap/BlueMapIntegration.java index 4eb3e71..2dc69fe 100644 --- a/BlueBridgeCore/src/main/java/de/mark225/bluebridge/core/bluemap/BlueMapIntegration.java +++ b/BlueBridgeCore/src/main/java/de/mark225/bluebridge/core/bluemap/BlueMapIntegration.java @@ -32,7 +32,7 @@ public class BlueMapIntegration { public void onEnable(BlueMapAPI blueMapAPI) { this.blueMapAPI = blueMapAPI; - Bukkit.getScheduler().runTask(BlueBridgeCore.getInstance(), () -> { + Bukkit.getAsyncScheduler().runNow(BlueBridgeCore.getInstance(), x -> { BlueBridgeCore.getInstance().updateConfig(); BlueBridgeCore.getInstance().reloadAddons(); createMarkerSets(); diff --git a/BlueBridgeCore/src/main/java/de/mark225/bluebridge/core/update/UpdateTask.java b/BlueBridgeCore/src/main/java/de/mark225/bluebridge/core/update/UpdateTask.java index d2b745e..0611b05 100644 --- a/BlueBridgeCore/src/main/java/de/mark225/bluebridge/core/update/UpdateTask.java +++ b/BlueBridgeCore/src/main/java/de/mark225/bluebridge/core/update/UpdateTask.java @@ -16,6 +16,7 @@ import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.TimeUnit; public class UpdateTask extends BukkitRunnable { @@ -34,7 +35,7 @@ public static synchronized void resetLastSnapshots() { public static synchronized void createAndSchedule(boolean instant) { if (currentTask == null && !locked) { currentTask = new UpdateTask(); - currentTask.runTaskLater(BlueBridgeCore.getInstance(), instant ? 0L : BlueBridgeConfig.updateInterval()); + Bukkit.getAsyncScheduler().runDelayed(BlueBridgeCore.getInstance(), x -> currentTask.run(), instant ? 0L : BlueBridgeConfig.updateInterval()*50, TimeUnit.MICROSECONDS); } } @@ -53,14 +54,14 @@ public void run() { for (BlueBridgeAddon addon : addons) { if(addon.supportsAsync()) continue; collectSnapshots(addon, newSnapshots); - } - Bukkit.getScheduler().runTaskAsynchronously(BlueBridgeCore.getInstance(), () ->{ - for (BlueBridgeAddon addon : addons) { - if(!addon.supportsAsync()) continue; - collectSnapshots(addon, newSnapshots); } - doUpdate(newSnapshots); - }); + Bukkit.getAsyncScheduler().runNow(BlueBridgeCore.getInstance(), x -> { + for (BlueBridgeAddon addon : addons) { + if(!addon.supportsAsync()) continue; + collectSnapshots(addon, newSnapshots); + } + doUpdate(newSnapshots); + }); } private void collectSnapshots(BlueBridgeAddon addon, ConcurrentMap> newSnapshots){ diff --git a/BlueBridgeCore/src/main/resources/config.yml b/BlueBridgeCore/src/main/resources/config.yml index d7254cf..880455c 100644 --- a/BlueBridgeCore/src/main/resources/config.yml +++ b/BlueBridgeCore/src/main/resources/config.yml @@ -1,4 +1,4 @@ -# Number of ticks to wait between every update. The default of 200 means 10 seconds. +# Number of ticks (1 tick is 50 miliseconds) to wait between every update. The default of 200 means 10 seconds. updateInterval: 200 # If this is set to true, all regions will be displayed as markers by default unless their region specific setting is false. diff --git a/BlueBridgeCore/src/main/resources/plugin.yml b/BlueBridgeCore/src/main/resources/plugin.yml index da04757..e3bd0ac 100644 --- a/BlueBridgeCore/src/main/resources/plugin.yml +++ b/BlueBridgeCore/src/main/resources/plugin.yml @@ -4,4 +4,5 @@ version: ${gradleVersion} authors: [ ${ contributors } ] website: https://github.com/Mark-225/BlueBridge api-version: 1.13 -depend: [ "BlueMap" ] \ No newline at end of file +depend: [ "BlueMap" ] +folia-supported: true \ No newline at end of file diff --git a/BlueBridgeGP/build.gradle b/BlueBridgeGP/build.gradle index 5fe01c8..f400d4f 100644 --- a/BlueBridgeGP/build.gradle +++ b/BlueBridgeGP/build.gradle @@ -1,5 +1,6 @@ dependencies { implementation project(':BlueBridgeCore') - provided 'com.github.BlueMap-Minecraft:BlueMapAPI:2.5.0' + provided 'de.bluecolored.bluemap:BlueMapAPI:2.7.2' implementation 'com.github.TechFortress:GriefPrevention:16.17.1' + compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT") } diff --git a/BlueBridgeGP/src/main/java/de/mark225/bluebridge/griefprevention/addon/GriefPreventionIntegration.java b/BlueBridgeGP/src/main/java/de/mark225/bluebridge/griefprevention/addon/GriefPreventionIntegration.java index 3425f14..79ad21f 100644 --- a/BlueBridgeGP/src/main/java/de/mark225/bluebridge/griefprevention/addon/GriefPreventionIntegration.java +++ b/BlueBridgeGP/src/main/java/de/mark225/bluebridge/griefprevention/addon/GriefPreventionIntegration.java @@ -32,9 +32,9 @@ public void addOrUpdateClaim(Claim claim) { //Schedule updates for all child claims if (claim.children != null && !claim.children.isEmpty()) { for (Claim child : claim.children) { - Bukkit.getScheduler().runTaskLater(BlueBridgeGP.getInstance(), () -> { + Bukkit.getAsyncScheduler().runNow(BlueBridgeGP.getInstance(), x -> { addOrUpdateClaim(child); - }, 0l); + }); } } diff --git a/BlueBridgeGP/src/main/resources/plugin.yml b/BlueBridgeGP/src/main/resources/plugin.yml index 3fc9744..0037e0e 100644 --- a/BlueBridgeGP/src/main/resources/plugin.yml +++ b/BlueBridgeGP/src/main/resources/plugin.yml @@ -4,4 +4,5 @@ version: ${gradleVersion} authors: [ ${ contributors } ] website: https://github.com/Mark-225/BlueBridge api-version: 1.13 -depend: [ "BlueBridgeCore", "GriefPrevention" ] \ No newline at end of file +depend: [ "BlueBridgeCore", "GriefPrevention" ] +folia-supported: true \ No newline at end of file diff --git a/BlueBridgeWB/build.gradle b/BlueBridgeWB/build.gradle index 0314cbe..65b4e89 100644 --- a/BlueBridgeWB/build.gradle +++ b/BlueBridgeWB/build.gradle @@ -1,4 +1,4 @@ dependencies { implementation project(':BlueBridgeCore') - provided 'com.github.BlueMap-Minecraft:BlueMapAPI:2.5.0' + provided 'de.bluecolored.bluemap:BlueMapAPI:2.7.2' } \ No newline at end of file diff --git a/BlueBridgeWB/src/main/resources/plugin.yml b/BlueBridgeWB/src/main/resources/plugin.yml index cd4062d..5af3935 100644 --- a/BlueBridgeWB/src/main/resources/plugin.yml +++ b/BlueBridgeWB/src/main/resources/plugin.yml @@ -4,4 +4,5 @@ version: ${gradleVersion} authors: [ ${ contributors } ] website: https://github.com/Mark-225/BlueBridge api-version: 1.13 -depend: [ "BlueBridgeCore" ] \ No newline at end of file +depend: [ "BlueBridgeCore" ] +folia-supported: true \ No newline at end of file diff --git a/BlueBridgeWG/build.gradle b/BlueBridgeWG/build.gradle index 2ab1685..246b370 100644 --- a/BlueBridgeWG/build.gradle +++ b/BlueBridgeWG/build.gradle @@ -4,6 +4,6 @@ repositories { dependencies { implementation project(':BlueBridgeCore') - provided 'com.github.BlueMap-Minecraft:BlueMapAPI:2.5.0' + provided 'de.bluecolored.bluemap:BlueMapAPI:2.7.2' implementation 'com.sk89q.worldguard:worldguard-bukkit:7.0.0' } diff --git a/BlueBridgeWG/src/main/resources/plugin.yml b/BlueBridgeWG/src/main/resources/plugin.yml index 234431a..7b8a911 100644 --- a/BlueBridgeWG/src/main/resources/plugin.yml +++ b/BlueBridgeWG/src/main/resources/plugin.yml @@ -4,4 +4,5 @@ version: ${gradleVersion} authors: [ ${ contributors } ] website: https://github.com/Mark-225/BlueBridge api-version: 1.13 -depend: [ "BlueBridgeCore", "WorldGuard" ] \ No newline at end of file +depend: [ "BlueBridgeCore", "WorldGuard" ] +folia-supported: true \ No newline at end of file diff --git a/build.gradle b/build.gradle index 556440d..bca8bc3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins{ id "java" id "idea" + id 'com.gradleup.shadow' version '8.3.0' } subprojects { @@ -12,15 +13,16 @@ subprojects { //Contributors are added to this list in the order of their first contribution. Separate using a comma and space. def authors = 'Mark_225, Aurelien30000' - sourceCompatibility = 11 - targetCompatibility = 11 + sourceCompatibility = 21 + targetCompatibility = 21 group 'de.mark225' repositories { mavenCentral() + maven { url 'https://repo.bluecolored.de/releases' } maven { url "https://jitpack.io" } - maven { url "https://hub.spigotmc.org/nexus/content/repositories/snapshots" } + maven { url "https://repo.papermc.io/repository/maven-public/" } } configurations { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..e1adfb4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists