From 958aac3cb18e78d0c0a71658ee3f44ec6f1b5d81 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sat, 18 Dec 2021 13:12:00 +0100 Subject: [PATCH 01/10] chore: Configure bolt --- .whitesource | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .whitesource diff --git a/.whitesource b/.whitesource new file mode 100644 index 000000000..7783a0b47 --- /dev/null +++ b/.whitesource @@ -0,0 +1,13 @@ +{ + "scanSettings": { + "baseBranches": ["v6"] + }, + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure", + "displayMode": "diff" + }, + "issueSettings": { + "minSeverityLevel": "LOW" + }, + "enableRenovate": "true" +} From 7002df0bc74c5b4f40421833c5ccb18723b800c7 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sat, 18 Dec 2021 23:10:41 +0100 Subject: [PATCH 02/10] build: Bump dependencies for 1.18 --- build.gradle.kts | 10 +++++++++- gradle/libs.versions.toml | 12 ++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2840545a8..91e9f240e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -72,10 +72,18 @@ allprojects { plugins.withId("java") { the().toolchain { - languageVersion.set(JavaLanguageVersion.of(16)) + languageVersion.set(JavaLanguageVersion.of(17)) } } + tasks.compileJava.configure { + options.release.set(16) + } + + configurations.all { + attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17) + } + configure { header(rootProject.file("HEADER.txt")) include("**/*.java") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9fc14f6f1..192ca7427 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,15 +1,15 @@ [versions] # Minecraft expectations -gson = "2.8.0" # Version set by Minecraft -log4j-api = "2.16.0" # Version set by Minecraft -guava = "21.0" # Version set by Minecraft +gson = "2.8.9" # Version set by Minecraft +log4j-api = "2.17.0" # Version set by Minecraft +guava = "31.0.1-jre" # Version set by Minecraft # Platform expectations -paper = "1.17.1-R0.1-SNAPSHOT" +paper = "1.18.1-R0.1-SNAPSHOT" checker-qual = "3.20.0" guice = "5.0.1" findbugs = "3.0.1" -snakeyaml = "1.28" # Version set by Bukkit +snakeyaml = "1.30" # Version set by Bukkit # Adventure & MiniMessage adventure-api = "4.9.3" @@ -39,7 +39,7 @@ serverlib = "2.3.1" http4j = "1.3" # Gradle plugins -shadow = "7.1.0" +shadow = "7.1.1" grgit = "4.1.1" licenser = "0.6.1" nexus = "1.1.0" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84d1f85fd..d2880ba80 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.3.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 76b58485a93a45a0d536bc42ae391da18eb9ad9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 11:55:14 +0100 Subject: [PATCH 03/10] build: Update actions/checkout action to v2.4.0 (#3393) * build: Update actions/checkout action to v2.4.0 * chore: Invert bolt's status Co-authored-by: Renovate Bot Co-authored-by: NotMyFault --- .github/workflows/build.yml | 2 +- .whitesource | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 275c96b38..d7d8ad300 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v2.3.5 + uses: actions/checkout@v2.4.0 - name: Validate Gradle Wrapper" uses: gradle/wrapper-validation-action@v1.0.4 - name: Setup Java diff --git a/.whitesource b/.whitesource index 7783a0b47..1a6d4ff8c 100644 --- a/.whitesource +++ b/.whitesource @@ -3,7 +3,7 @@ "baseBranches": ["v6"] }, "checkRunSettings": { - "vulnerableCheckRunConclusionLevel": "failure", + "vulnerableCheckRunConclusionLevel": "success", "displayMode": "diff" }, "issueSettings": { From b9d43897afcd347f97997563e04587cde901004b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 11:55:46 +0100 Subject: [PATCH 04/10] build: Update dependency net.essentialsx:EssentialsX to v2.19.2 (#3392) Co-authored-by: Renovate Bot --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 192ca7427..15fe82682 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,7 @@ fawe = "1.17-419" vault = "1.7.1" placeholderapi = "2.10.10" luckperms = "5.3" -essentialsx = "2.19.0" +essentialsx = "2.19.2" hyperverse = "0.6.0-SNAPSHOT" mvdwapi = "3.1.1" From d881cb608410c28980b0f50e9bf5e40dfe947ad1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 11:55:54 +0100 Subject: [PATCH 05/10] build: Update dependency com.intellectualsites.paster:Paster to v1.1.3 (#3391) Co-authored-by: Renovate Bot --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 15fe82682..818430c9e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,7 +31,7 @@ prtree = "2.0.0" aopalliance = "1.0" rorledning = "1.4.0-SNAPSHOT" arkitektonika = "2.1.1" -paster = "1.1.1" +paster = "1.1.3" bstats = "2.2.1" paperlib = "1.0.7" squirrelid = "0.3.0" From 9394906a797a7818e35b91ac1b834b154fea6a3f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 13:47:16 +0100 Subject: [PATCH 06/10] build: Update dependency org.checkerframework:checker-qual to v3.21.0 (#3394) Co-authored-by: Renovate Bot --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 818430c9e..a948ef324 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ guava = "31.0.1-jre" # Version set by Minecraft # Platform expectations paper = "1.18.1-R0.1-SNAPSHOT" -checker-qual = "3.20.0" +checker-qual = "3.21.0" guice = "5.0.1" findbugs = "3.0.1" snakeyaml = "1.30" # Version set by Bukkit From 3da1e9255a1252aa57642d17db7ddd43591f3b86 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Dec 2021 10:49:47 +0100 Subject: [PATCH 07/10] build: Update dependency me.clip:placeholderapi to v2.11.0 (#3395) Co-authored-by: Renovate Bot --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a948ef324..5239ee648 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,7 +20,7 @@ adventure-platform-bukkit = "4.0.1" worldedit = "7.2.8" fawe = "1.17-419" vault = "1.7.1" -placeholderapi = "2.10.10" +placeholderapi = "2.11.0" luckperms = "5.3" essentialsx = "2.19.2" hyperverse = "0.6.0-SNAPSHOT" From af2613202d05d1069d4416b53c50018dce2a6752 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Wed, 22 Dec 2021 02:06:07 +0100 Subject: [PATCH 08/10] refactor: Satisfy Semgrep --- .../plotsquared/bukkit/listener/EntitySpawnListener.java | 2 +- Core/src/main/java/com/plotsquared/core/util/StringMan.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java index 151c2f40a..783622e63 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java @@ -75,7 +75,7 @@ public class EntitySpawnListener implements Listener { public static void testCreate(final Entity entity) { @NonNull World world = entity.getWorld(); - if (areaName == world.getName()) { + if (areaName.equals(world.getName())) { } else { areaName = world.getName(); hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName); diff --git a/Core/src/main/java/com/plotsquared/core/util/StringMan.java b/Core/src/main/java/com/plotsquared/core/util/StringMan.java index ee7a614b8..388e46135 100644 --- a/Core/src/main/java/com/plotsquared/core/util/StringMan.java +++ b/Core/src/main/java/com/plotsquared/core/util/StringMan.java @@ -286,15 +286,13 @@ public class StringMan { } public static boolean isEqualIgnoreCase(String a, String b) { - return (a == b) || ((a != null) && (b != null) && (a.length() == b.length()) && a + return (a.equals(b)) || ((a != null) && (b != null) && (a.length() == b.length()) && a .equalsIgnoreCase(b)); } public static String repeat(String s, int n) { StringBuilder sb = new StringBuilder(); - for (int i = 0; i < n; i++) { - sb.append(s); - } + sb.append(String.valueOf(s).repeat(Math.max(0, n))); return sb.toString(); } From a7026047d095ff6806b1ca8fe3deb1cd76d66ee7 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 22 Dec 2021 17:46:39 +0000 Subject: [PATCH 09/10] Adding gold at the end might stop the prefix weirdness? --- Core/src/main/resources/lang/messages_en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 9a0726c90..69c2cb529 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -22,7 +22,7 @@ "web.plot_merged": "This plot is merged and therefore cannot be downloaded", "web.generating_link_failed": "Failed to generate download link for plot !", "web.generation_link_success": "Download: > \n Deletion: >\nAttention: Opening the deletion link will delete the file immediately.", - "web.generation_link_success_legacy_world": "Download: >", + "web.generation_link_success_legacy_world": "Download: >", "web.save_failed": "Failed to save.", "web.load_null": "Please use to get a list of schematics.", "web.load_failed": "Failed to load schematic.", From 1f26808c7b260b4eec8e5e99ab1495cbdc172acf Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 22 Dec 2021 17:47:48 +0000 Subject: [PATCH 10/10] Don't return the "side" for world plots when accessing default home locations --- .../java/com/plotsquared/core/plot/Plot.java | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index db5e58e4b..92408c827 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -40,7 +40,6 @@ import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.events.Result; import com.plotsquared.core.events.TeleportCause; import com.plotsquared.core.generator.ClassicPlotWorld; -import com.plotsquared.core.generator.HybridPlotWorld; import com.plotsquared.core.listener.PlotListener; import com.plotsquared.core.location.BlockLoc; import com.plotsquared.core.location.Direction; @@ -59,6 +58,7 @@ import com.plotsquared.core.plot.flag.implementations.KeepFlag; import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag; import com.plotsquared.core.plot.flag.types.DoubleFlag; import com.plotsquared.core.plot.schematic.Schematic; +import com.plotsquared.core.plot.world.SinglePlotArea; import com.plotsquared.core.queue.QueueCoordinator; import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.MathMan; @@ -1512,6 +1512,12 @@ public class Plot { int z; if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) { // center + if (getArea() instanceof SinglePlotArea) { + int y = loc.getY() == Integer.MIN_VALUE + ? (isLoaded() ? this.worldUtil.getHighestBlockSynchronous(plot.getWorldName(), 0, 0) + 1 : 63) + : loc.getY(); + return Location.at(plot.getWorldName(), 0, y, 0, 0, 0); + } CuboidRegion largest = plot.getLargestRegion(); x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest .getMinimumPoint() @@ -1530,6 +1536,10 @@ public class Plot { : loc.getY(); return Location.at(plot.getWorldName(), x, y, z, loc.getYaw(), loc.getPitch()); } + if (getArea() instanceof SinglePlotArea) { + int y = isLoaded() ? this.worldUtil.getHighestBlockSynchronous(plot.getWorldName(), 0, 0) + 1 : 63; + return Location.at(plot.getWorldName(), 0, y, 0, 0, 0); + } // Side return plot.getSideSynchronous(); } @@ -1551,20 +1561,25 @@ public class Plot { int z; if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) { // center - CuboidRegion largest = plot.getLargestRegion(); - x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest - .getMinimumPoint() - .getX(); - z = (largest.getMaximumPoint().getZ() >> 1) - (largest.getMinimumPoint().getZ() >> 1) + largest - .getMinimumPoint() - .getZ(); + if (getArea() instanceof SinglePlotArea) { + x = 0; + z = 0; + } else { + CuboidRegion largest = plot.getLargestRegion(); + x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest + .getMinimumPoint() + .getX(); + z = (largest.getMaximumPoint().getZ() >> 1) - (largest.getMinimumPoint().getZ() >> 1) + largest + .getMinimumPoint() + .getZ(); + } } else { // specific Location bot = plot.getBottomAbs(); x = bot.getX() + loc.getX(); z = bot.getZ() + loc.getZ(); } - if (loc.getY() == Integer.MIN_VALUE) { + if (loc.getY() == Integer.MIN_VALUE) { if (isLoaded()) { this.worldUtil.getHighestBlock( plot.getWorldName(), @@ -1582,6 +1597,10 @@ public class Plot { return; } // Side + if (getArea() instanceof SinglePlotArea) { + int y = isLoaded() ? this.worldUtil.getHighestBlockSynchronous(plot.getWorldName(), 0, 0) + 1 : 63; + result.accept(Location.at(plot.getWorldName(), 0, y, 0, 0, 0)); + } plot.getSide(result); }