From f7f5b1dab9e14eb2b9389c1dbf5fb43385349df3 Mon Sep 17 00:00:00 2001 From: Nailm Date: Thu, 1 Jun 2023 17:36:39 +0800 Subject: [PATCH] Back command improvement (#422) --- bukkit/build.gradle | 2 +- common/build.gradle | 4 ++-- .../java/net/william278/huskhomes/command/BackCommand.java | 5 ++++- .../java/net/william278/huskhomes/teleport/Teleport.java | 5 ++++- paper/build.gradle | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bukkit/build.gradle b/bukkit/build.gradle index 5741e612..50facea0 100644 --- a/bukkit/build.gradle +++ b/bukkit/build.gradle @@ -13,7 +13,7 @@ dependencies { compileOnly 'net.william278:Annotaml:2.0.1' compileOnly 'net.william278:DesertWell:2.0.4' compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1' - compileOnly 'com.github.Emibergo02:RedisEconomy:3.2-SNAPSHOT' + compileOnly 'com.github.Emibergo02:RedisEconomy:3.4-SNAPSHOT' compileOnly 'me.clip:placeholderapi:2.11.3' compileOnly 'net.essentialsx:EssentialsX:2.19.7' diff --git a/common/build.gradle b/common/build.gradle index 0e3789c4..286b5416 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -26,11 +26,11 @@ dependencies { compileOnly 'org.jetbrains:annotations:24.0.1' compileOnly 'com.google.guava:guava:32.0.0-jre' - compileOnly 'com.github.plan-player-analytics:Plan:5.5.1923' + compileOnly 'com.github.plan-player-analytics:Plan:5.5.2391' compileOnly 'com.github.BlueMap-Minecraft:BlueMapAPI:2.5.0' compileOnly 'us.dynmap:DynmapCoreAPI:3.4' compileOnly 'maven.modrinth:pl3xmap:1.19.4-433' - testImplementation 'com.github.plan-player-analytics:Plan:5.5.1923' + testImplementation 'com.github.plan-player-analytics:Plan:5.5.2391' testImplementation 'com.github.yuriy-g:simple-java-plot:5c502c2e98' } \ No newline at end of file diff --git a/common/src/main/java/net/william278/huskhomes/command/BackCommand.java b/common/src/main/java/net/william278/huskhomes/command/BackCommand.java index 7996a387..ffe7bd42 100644 --- a/common/src/main/java/net/william278/huskhomes/command/BackCommand.java +++ b/common/src/main/java/net/william278/huskhomes/command/BackCommand.java @@ -35,7 +35,10 @@ public class BackCommand extends InGameCommand { protected BackCommand(@NotNull HuskHomes plugin) { super("back", List.of(), "", plugin); - addAdditionalPermissions(Map.of("death", false)); + addAdditionalPermissions(Map.of( + "death", false, + "previous", false + )); } @Override diff --git a/common/src/main/java/net/william278/huskhomes/teleport/Teleport.java b/common/src/main/java/net/william278/huskhomes/teleport/Teleport.java index 73062588..9afbee9b 100644 --- a/common/src/main/java/net/william278/huskhomes/teleport/Teleport.java +++ b/common/src/main/java/net/william278/huskhomes/teleport/Teleport.java @@ -62,7 +62,10 @@ public class Teleport { this.economyActions = actions; this.async = plugin.getSettings().doAsynchronousTeleports(); this.updateLastPosition = updateLastPosition && plugin.getCommand(BackCommand.class) - .map(command -> executor.hasPermission(command.getPermission())) + .map(command -> + executor.hasPermission(command.getPermission()) && + executor.hasPermission(command.getPermission("previous")) + ) .orElse(false); } diff --git a/paper/build.gradle b/paper/build.gradle index 3cede6f0..a2b64ade 100644 --- a/paper/build.gradle +++ b/paper/build.gradle @@ -15,7 +15,7 @@ dependencies { compileOnly 'net.william278:DesertWell:2.0.4' compileOnly 'me.lucko:commodore:2.2' compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1' - compileOnly 'com.github.Emibergo02:RedisEconomy:3.2-SNAPSHOT' + compileOnly 'com.github.Emibergo02:RedisEconomy:3.4-SNAPSHOT' compileOnly 'me.clip:placeholderapi:2.11.3' }