diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1f19a8e80..fd25c3a0d 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -13,6 +13,9 @@ on: jobs: test: runs-on: ubuntu-18.04 + strategy: + matrix: + java: [1.8, 1.11] steps: - name: Checkout diff --git a/Bukkit/build.gradle.kts b/Bukkit/build.gradle.kts index d69c5c113..426aae046 100644 --- a/Bukkit/build.gradle.kts +++ b/Bukkit/build.gradle.kts @@ -43,11 +43,11 @@ dependencies { implementation("org.bstats:bstats-bukkit:1.7") // Minecraft - compileOnlyApi("com.destroystokyo.paper:paper-api:1.16.3-R0.1-SNAPSHOT") + compileOnlyApi("com.destroystokyo.paper:paper-api:1.16.4-R0.1-SNAPSHOT") implementation("io.papermc:paperlib:1.0.5") // Plugins - compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT") { + compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.0") { exclude(group = "org.bukkit") exclude(group = "org.spigotmc") } diff --git a/Bukkit/src/main/resources/plugin.yml b/Bukkit/src/main/resources/plugin.yml index 91579acdb..bd5328e27 100644 --- a/Bukkit/src/main/resources/plugin.yml +++ b/Bukkit/src/main/resources/plugin.yml @@ -141,6 +141,8 @@ permissions: default: false plots.visit.other: default: false + plots.visit.denied: + default: false plots.home: default: false plots.alias.remove: diff --git a/Core/build.gradle.kts b/Core/build.gradle.kts index aee1b3d4f..99e3d0a22 100644 --- a/Core/build.gradle.kts +++ b/Core/build.gradle.kts @@ -26,12 +26,12 @@ dependencies { compileOnlyApi("javax.inject:javax.inject:1") // Plugins - compileOnlyApi("com.sk89q.worldedit:worldedit-core:7.2.0-SNAPSHOT") { + compileOnlyApi("com.sk89q.worldedit:worldedit-core:7.2.0") { exclude(group = "bukkit-classloader-check") exclude(group = "mockito-core") exclude(group = "dummypermscompat") } - testImplementation("com.sk89q.worldedit:worldedit-core:7.2.0-SNAPSHOT") + testImplementation("com.sk89q.worldedit:worldedit-core:7.2.0") // Logging api("org.slf4j:slf4j-api:1.7.25") diff --git a/Core/src/main/java/com/plotsquared/core/command/Auto.java b/Core/src/main/java/com/plotsquared/core/command/Auto.java index 67ec75aae..c4cd060f8 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Auto.java +++ b/Core/src/main/java/com/plotsquared/core/command/Auto.java @@ -108,10 +108,12 @@ public class Auto extends SubCommand { if (metaDataAccess.isPresent()) { int grantedPlots = metaDataAccess.get().orElse(0); if (diff < 0 && grantedPlots < sizeX * sizeZ) { - player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots")); + player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots"), + Template.of("amount", String.valueOf(diff + grantedPlots))); return false; } else if (diff >= 0 && grantedPlots + diff < sizeX * sizeZ) { - player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots")); + player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots"), + Template.of("amount", String.valueOf(diff + grantedPlots))); return false; } else { int left = grantedPlots + diff < 0 ? 0 : diff - sizeX * sizeZ; @@ -125,7 +127,8 @@ public class Auto extends SubCommand { Template.of("remainingGrants", String.valueOf(left))); } } else { - player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots")); + player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots"), + Template.of("amount", "0")); return false; } } diff --git a/Core/src/main/java/com/plotsquared/core/command/Buy.java b/Core/src/main/java/com/plotsquared/core/command/Buy.java index a4326112a..c7074abc5 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Buy.java +++ b/Core/src/main/java/com/plotsquared/core/command/Buy.java @@ -87,7 +87,8 @@ public class Buy extends Command { checkTrue(!plot.isOwner(player.getUUID()), TranslatableCaption.of("economy.cannot_buy_own")); Set plots = plot.getConnectedPlots(); checkTrue(player.getPlotCount() + plots.size() <= player.getAllowedPlots(), - TranslatableCaption.of("permission.cant_claim_more_plots")); + TranslatableCaption.of("permission.cant_claim_more_plots"), + Template.of("amount", String.valueOf(player.getAllowedPlots()))); double price = plot.getFlag(PriceFlag.class); if (price <= 0) { throw new CommandException(TranslatableCaption.of("economy.not_for_sale")); diff --git a/Core/src/main/java/com/plotsquared/core/command/Claim.java b/Core/src/main/java/com/plotsquared/core/command/Claim.java index 92646e6e2..8e0ad7815 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Claim.java +++ b/Core/src/main/java/com/plotsquared/core/command/Claim.java @@ -104,10 +104,12 @@ public class Claim extends SubCommand { grants = metaDataAccess.get().orElse(0); if (grants <= 0) { metaDataAccess.remove(); - player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots")); + player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots"), + Template.of("amount", String.valueOf(grants))); } } else { - player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots")); + player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots"), + Template.of("amount", String.valueOf(grants))); } } diff --git a/Core/src/main/java/com/plotsquared/core/command/Visit.java b/Core/src/main/java/com/plotsquared/core/command/Visit.java index b75182ee0..a490ea472 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Visit.java +++ b/Core/src/main/java/com/plotsquared/core/command/Visit.java @@ -135,6 +135,13 @@ public class Visit extends Command { Templates.of("node", "plots.admin.visit.untrusted")); return; } + if (plot.isDenied(player.getUUID())) { + if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_DENIED)) { + player.sendMessage(TranslatableCaption.of("permission.no_permission"), + Template.of("node", String.valueOf(Permission.PERMISSION_VISIT_DENIED))); + return; + } + } } confirm.run(this, () -> plot.teleportPlayer(player, TeleportCause.COMMAND, result -> { diff --git a/Core/src/main/java/com/plotsquared/core/permissions/Permission.java b/Core/src/main/java/com/plotsquared/core/permissions/Permission.java index 9d5883891..234d7135b 100644 --- a/Core/src/main/java/com/plotsquared/core/permissions/Permission.java +++ b/Core/src/main/java/com/plotsquared/core/permissions/Permission.java @@ -157,6 +157,7 @@ public enum Permission { PERMISSION_VISIT_UNOWNED("plots.visit.unowned"), PERMISSION_VISIT_OWNED("plots.visit.owned"), PERMISSION_SHARED("plots.visit.shared"), + PERMISSION_VISIT_DENIED("plots.visit.denied"), PERMISSION_VISIT_OTHER("plots.visit.other"), PERMISSION_HOME("plots.home"), PERMISSION_ALIAS_SET("plots.alias.set"), diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index d2035e6aa..e0b03fb9e 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -208,7 +208,7 @@ "permission.no_permission": "You are lacking the permission node: .", "permission.no_permission_event": "You are lacking the permission node: .", "permission.no_plot_perms": "You must be the plot owner to perform this action.", - "permission.cant_claim_more_plots": "You can't claim more plots.", + "permission.cant_claim_more_plots": "You can't claim more than plots.", "permission.cant_claim_more_clusters": "You can't claim more clusters.", "permission.cant_transfer_more_plots": "You can't send more plots to that user.", "permission.cant_claim_more_plots_num": "You can't claim more than plots at once.", diff --git a/Core/src/main/resources/town.template b/Core/src/main/resources/town.template index 5210fc432..c38034864 100644 Binary files a/Core/src/main/resources/town.template and b/Core/src/main/resources/town.template differ