From cfd432886d6789a0bba34374de6904a3a2e2c5ed Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 11 Oct 2020 19:19:17 +0100 Subject: [PATCH 1/9] Correctly handle road flags --- .../com/plotsquared/core/plot/PlotArea.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java index 704068a3d..0076b27e2 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java @@ -374,24 +374,21 @@ public abstract class PlotArea { this.spawnCustom = config.getBoolean("event.spawn.custom"); this.spawnBreeding = config.getBoolean("event.spawn.breeding"); - List roadflags = config.getStringList("flags.default"); + List roadflags = config.getStringList("road.flags"); if (roadflags.isEmpty()) { - roadflags = config.getStringList("road.flags"); - if (roadflags.isEmpty()) { - roadflags = new ArrayList<>(); - ConfigurationSection section = config.getConfigurationSection("road.flags"); - Set keys = section.getKeys(false); - for (String key : keys) { - if (!"default".equals(key)) { - roadflags.add(key + ';' + section.get(key)); - } + roadflags = new ArrayList<>(); + ConfigurationSection section = config.getConfigurationSection("road.flags"); + Set keys = section.getKeys(false); + for (String key : keys) { + if (!"default".equals(key)) { + roadflags.add(key + ';' + section.get(key)); } } } this.getRoadFlagContainer().addAll(parseFlags(roadflags)); StringBuilder roadFlagBuilder = new StringBuilder(); - Collection> roadFlagCollection = this.getFlagContainer().getFlagMap().values(); + Collection> roadFlagCollection = this.getRoadFlagContainer().getFlagMap().values(); if (roadFlagCollection.isEmpty()) { roadFlagBuilder.append(Captions.NONE.getTranslated()); } else { From 565f9e3e2982d1ed0fa4392a75e4351f91c77755 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 11 Oct 2020 19:27:01 +0100 Subject: [PATCH 2/9] 5.13.8 --- Bukkit/pom.xml | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bukkit/pom.xml b/Bukkit/pom.xml index a9cf4c54f..2211b15d9 100644 --- a/Bukkit/pom.xml +++ b/Bukkit/pom.xml @@ -21,7 +21,7 @@ com.plotsquared PlotSquared-Core - 5.13.7 + 5.13.8 compile diff --git a/build.gradle b/build.gradle index 2f0fb1056..bd9095e3e 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ ext { git = Grgit.open(dir: new File(rootDir.toString() + "/.git")) } -def ver = "5.13.7" +def ver = "5.13.8" def versuffix = "" ext { if (project.hasProperty("versionsuffix")) { From 4213957d76b8d12ebea53a59010c25b8f1e881c7 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Mon, 12 Oct 2020 12:21:32 +0200 Subject: [PATCH 3/9] Delete dependabot.yml --- .github/dependabot.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 3fe9883e9..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: 2 -updates: -- package-ecosystem: gradle - directory: "/" - schedule: - interval: weekly - open-pull-requests-limit: 10 - target-branch: v5 - ignore: - - dependency-name: com.google.guava:guava - versions: - - ">= 22.a" - - "< 23" - - dependency-name: com.google.guava:guava - versions: - - ">= 23.a" - - "< 24" - - dependency-name: com.squareup.okhttp3:okhttp - versions: - - "> 4.2.2" - - dependency-name: com.squareup.okio:okio - versions: - - "> 2.4.1" - - "< 3" - - dependency-name: com.squareup.retrofit2:retrofit - versions: - - "> 2.4.0" - - "< 3" - - dependency-name: net.kyori:text-adapter-bukkit - versions: - - "> 3.0.3" - - "< 3.1" From b66e2359d1a0e48e88a54a87e345b73855613722 Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Tue, 3 Nov 2020 15:58:17 +0100 Subject: [PATCH 4/9] Update to 1.16.4 - Bump WorldEdit to 7.2.0 release --- Bukkit/build.gradle | 6 +++--- Bukkit/pom.xml | 8 ++++---- Core/pom.xml | 2 +- build.gradle | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Bukkit/build.gradle b/Bukkit/build.gradle index b0c628c5c..f8770c04f 100644 --- a/Bukkit/build.gradle +++ b/Bukkit/build.gradle @@ -23,9 +23,9 @@ dependencies { implementation(project(":PlotSquared-Core")) compile("org.bstats:bstats-bukkit:1.7") compile(project(":PlotSquared-Core")) - compile("com.destroystokyo.paper:paper-api:1.16.2-R0.1-SNAPSHOT") - implementation("org.spigotmc:spigot-api:1.16.2-R0.1-SNAPSHOT") - compile(group: "com.sk89q.worldedit", name: "worldedit-bukkit", version: "7.2.0-SNAPSHOT") { + compile("com.destroystokyo.paper:paper-api:1.16.4-R0.1-SNAPSHOT") + implementation("org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT") + compile(group: "com.sk89q.worldedit", name: "worldedit-bukkit", version: "7.2.0") { exclude(module: "bukkit") } compile("io.papermc:paperlib:1.0.4") diff --git a/Bukkit/pom.xml b/Bukkit/pom.xml index 2211b15d9..e059f957f 100644 --- a/Bukkit/pom.xml +++ b/Bukkit/pom.xml @@ -27,13 +27,13 @@ com.destroystokyo.paper paper-api - 1.16.2-R0.1-SNAPSHOT + 1.16.4-R0.1-SNAPSHOT compile com.sk89q.worldedit worldedit-bukkit - 7.2.0-SNAPSHOT + 7.2.0 compile @@ -99,7 +99,7 @@ com.sk89q.worldedit worldedit-core - 7.0.0 + 7.2.0 runtime @@ -149,7 +149,7 @@ org.spigotmc spigot-api - 1.16.2-R0.1-SNAPSHOT + 1.16.4-R0.1-SNAPSHOT runtime diff --git a/Core/pom.xml b/Core/pom.xml index 3d4ebf3a7..799c0a5a5 100644 --- a/Core/pom.xml +++ b/Core/pom.xml @@ -27,7 +27,7 @@ com.sk89q.worldedit worldedit-core - 7.0.0 + 7.2.0 runtime diff --git a/build.gradle b/build.gradle index bd9095e3e..dba40e35d 100644 --- a/build.gradle +++ b/build.gradle @@ -81,7 +81,7 @@ subprojects { dependencies { compile group: 'org.json', name: 'json', version: '20200518' - implementation("com.sk89q.worldedit:worldedit-core:7.0.0") { + implementation("com.sk89q.worldedit:worldedit-core:7.2.0") { exclude(module: "bukkit-classloader-check") exclude(module: "mockito-core") exclude(module: "dummypermscompat") From b0d55d434d7984cd5b984153cf5c10c754e0e9c9 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Tue, 3 Nov 2020 21:14:07 +0100 Subject: [PATCH 5/9] 5.13.9 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index dba40e35d..c9ad00319 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ ext { git = Grgit.open(dir: new File(rootDir.toString() + "/.git")) } -def ver = "5.13.8" +def ver = "5.13.9" def versuffix = "" ext { if (project.hasProperty("versionsuffix")) { From 5d4cf3b705287bb99d4c1125afebc7ff5d0faa72 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Tue, 10 Nov 2020 17:24:37 +0000 Subject: [PATCH 6/9] setowner should allow null UUIDs --- .../main/java/com/plotsquared/core/command/Owner.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Owner.java b/Core/src/main/java/com/plotsquared/core/command/Owner.java index f19790dc5..42e2df5e8 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Owner.java +++ b/Core/src/main/java/com/plotsquared/core/command/Owner.java @@ -146,15 +146,7 @@ public class Owner extends SetCommand { } catch (Exception ignored) { } } else { - PlotSquared.get().getImpromptuUUIDPipeline().getSingle(value, (uuid, throwable) -> { - if (throwable instanceof TimeoutException) { - MainUtil.sendMessage(player, Captions.FETCHING_PLAYERS_TIMEOUT); - } else if (throwable != null) { - MainUtil.sendMessage(player, Captions.INVALID_PLAYER, value); - } else { - uuidConsumer.accept(uuid); - } - }); + PlotSquared.get().getImpromptuUUIDPipeline().getSingle(value, (uuid, throwable) -> uuidConsumer.accept(uuid)); } return true; } From ef95334fe69a2644f600b44771d50d43a521012f Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Mon, 23 Nov 2020 18:32:28 +0100 Subject: [PATCH 7/9] Update actions worflow --- .github/stale.yml | 16 ----------- .github/workflows/build.yml | 20 ++++++++++++++ .github/workflows/gradle.yml | 27 ------------------- .github/workflows/validate-gradle-wrapper.yml | 12 +++++++++ 4 files changed, 32 insertions(+), 43 deletions(-) delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/gradle.yml create mode 100644 .github/workflows/validate-gradle-wrapper.yml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 96a6248b7..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - [‼] high priority -# Label to use when marking an issue as stale -staleLabel: Old -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..5344ca758 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: "build" + +on: ["pull_request", "push"] + +jobs: + build: + strategy: + matrix: + java: ["1.8", "11"] + os: ["ubuntu-18.04"] + runs-on: "${{ matrix.os }}" + steps: + - name: "Checkout Repository" + uses: "actions/checkout@v2.3.4" + - name: "Setup JDK ${{ matrix.java }}" + uses: "actions/setup-java@v1.4.3" + with: + java-version: "${{ matrix.java }}" + - name: "Clean Build" + run: "./gradlew clean build" \ No newline at end of file diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index 1f19a8e80..000000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Java CI - -on: - push: - branches: - - 'v5' - - 'v6' - pull_request: - branches: - - 'v5' - - 'v6' - -jobs: - test: - runs-on: ubuntu-18.04 - - steps: - - name: Checkout - uses: actions/checkout@v2.0.0 - - name: Setup Java JDK 1.8 - uses: actions/setup-java@v1.3.0 - with: - java-version: 1.8 - - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1 - - name: Test with Gradle - run: ./gradlew clean build diff --git a/.github/workflows/validate-gradle-wrapper.yml b/.github/workflows/validate-gradle-wrapper.yml new file mode 100644 index 000000000..e82749525 --- /dev/null +++ b/.github/workflows/validate-gradle-wrapper.yml @@ -0,0 +1,12 @@ +name: "validate gradle wrapper" + +on: ["pull_request", "push"] + +jobs: + build: + runs-on: "ubuntu-18.04" + steps: + - name: "Checkout Repository" + uses: "actions/checkout@v2.3.4" + - name: "Validate Gradle Wrapper" + uses: "gradle/wrapper-validation-action@v1.0.3" \ No newline at end of file From 585111ca38bdc0ededcc656873975cbf4535a669 Mon Sep 17 00:00:00 2001 From: Traks <58818927+traksag@users.noreply.github.com> Date: Tue, 24 Nov 2020 16:32:35 +0100 Subject: [PATCH 8/9] Cancel boat placement on interactable blocks, fixes PS-175 (#2934) * Cancel boat placement on interactable blocks, fixes PS-175 * Keep boat protection for old game versions Co-authored-by: NotMyFault --- .../bukkit/listener/PlayerEventListener.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java index c5bcfd8c9..996c5a2d8 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java @@ -85,6 +85,7 @@ import org.bukkit.block.BlockFace; import org.bukkit.block.data.Waterlogged; import org.bukkit.command.PluginCommand; import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.Boat; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.HumanEntity; @@ -100,6 +101,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityPickupItemEvent; +import org.bukkit.event.entity.EntityPlaceEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent; import org.bukkit.event.hanging.HangingPlaceEvent; @@ -1068,6 +1070,34 @@ public class PlayerEventListener extends PlotListener implements Listener { } } + // Boats can sometimes be placed on interactable blocks such as levers, + // see PS-175. Armor stands, minecarts and end crystals (the other entities + // supported by this event) don't have this issue. + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) + public void onBoatPlace(EntityPlaceEvent event) { + Player player = event.getPlayer(); + if (player == null) { + return; + } + Entity placed = event.getEntity(); + if (!(placed instanceof Boat)) { + return; + } + BukkitPlayer pp = BukkitUtil.getPlayer(player); + PlotArea area = pp.getPlotAreaAbs(); + if (area == null) { + return; + } + PlayerBlockEventType eventType = PlayerBlockEventType.PLACE_VEHICLE; + Block block = event.getBlock(); + BlockType blockType = BukkitAdapter.asBlockType(block.getType()); + Location location = BukkitUtil.getLocation(block.getLocation()); + if (!PlotSquared.get().getEventDispatcher() + .checkPlayerBlockEvent(pp, eventType, location, blockType, true)) { + event.setCancelled(true); + } + } + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBucketEmpty(PlayerBucketEmptyEvent event) { BlockFace bf = event.getBlockFace(); From ee7f683b76abdae898563ca791b9973fc6c562e5 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Thu, 26 Nov 2020 16:54:38 +0000 Subject: [PATCH 9/9] Bump paperlib, fix single worlds. --- Bukkit/build.gradle | 4 ++-- Bukkit/pom.xml | 4 ++-- .../com/plotsquared/bukkit/managers/BukkitWorldManager.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Bukkit/build.gradle b/Bukkit/build.gradle index f8770c04f..ff2e398fd 100644 --- a/Bukkit/build.gradle +++ b/Bukkit/build.gradle @@ -28,7 +28,7 @@ dependencies { compile(group: "com.sk89q.worldedit", name: "worldedit-bukkit", version: "7.2.0") { exclude(module: "bukkit") } - compile("io.papermc:paperlib:1.0.4") + compile("io.papermc:paperlib:1.0.5") implementation("net.kyori:text-adapter-bukkit:3.0.3") compile("com.github.MilkBowl:VaultAPI:1.7") { exclude(module: "bukkit") @@ -94,7 +94,7 @@ task copyFiles { shadowJar { dependencies { include(dependency(":PlotSquared-Core")) - include(dependency("io.papermc:paperlib:1.0.4")) + include(dependency("io.papermc:paperlib:1.0.5")) include(dependency("net.kyori:text-adapter-bukkit:3.0.3")) include(dependency("org.bstats:bstats-bukkit:1.7")) include(dependency("org.khelekore:prtree:1.7.0-SNAPSHOT")) diff --git a/Bukkit/pom.xml b/Bukkit/pom.xml index e059f957f..7918a3e5a 100644 --- a/Bukkit/pom.xml +++ b/Bukkit/pom.xml @@ -21,7 +21,7 @@ com.plotsquared PlotSquared-Core - 5.13.8 + 5.13.9 compile @@ -45,7 +45,7 @@ io.papermc paperlib - 1.0.4 + 1.0.5 compile diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java index 4646868a1..a1fbb6428 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java @@ -62,7 +62,7 @@ public class BukkitWorldManager implements PlatformWorldManager { } protected void setGenerator(@Nullable final String worldName, @Nullable final String generator) { - if (generator == null) { + if (generator == null || worldName != null && worldName.contains(".")) { return; } File file = new File("bukkit.yml").getAbsoluteFile();