From d811b30d3f7957770addff5d24684d672aa49536 Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 20 Jun 2019 18:01:26 -0700 Subject: [PATCH] Fix unknown player [name] bug Version up. --- pom.xml | 2 +- .../bentobox/level/commands/admin/AdminLevelCommand.java | 5 +++-- .../bentobox/level/commands/island/IslandLevelCommand.java | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index c76d008..da058e5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ world.bentobox level - 1.5.0 + 1.5.1-SNAPSHOT Level Level is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland. diff --git a/src/main/java/world/bentobox/level/commands/admin/AdminLevelCommand.java b/src/main/java/world/bentobox/level/commands/admin/AdminLevelCommand.java index a532acf..89a05a9 100644 --- a/src/main/java/world/bentobox/level/commands/admin/AdminLevelCommand.java +++ b/src/main/java/world/bentobox/level/commands/admin/AdminLevelCommand.java @@ -6,6 +6,7 @@ import java.util.Optional; import java.util.UUID; import world.bentobox.bentobox.api.commands.CompositeCommand; +import world.bentobox.bentobox.api.localization.TextVariables; import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.util.Util; import world.bentobox.level.Level; @@ -34,7 +35,7 @@ public class AdminLevelCommand extends CompositeCommand { // Convert name to a UUID final UUID playerUUID = getPlugin().getPlayers().getUUID(args.get(0)); if (playerUUID == null) { - user.sendMessage("general.errors.unknown-player"); + user.sendMessage("general.errors.unknown-player", TextVariables.NAME, args.get(0)); return true; } else { levelPlugin.calculateIslandLevel(getWorld(), user, playerUUID); @@ -45,7 +46,7 @@ public class AdminLevelCommand extends CompositeCommand { return false; } } - + @Override public Optional> tabComplete(User user, String alias, List args) { String lastArg = !args.isEmpty() ? args.get(args.size()-1) : ""; diff --git a/src/main/java/world/bentobox/level/commands/island/IslandLevelCommand.java b/src/main/java/world/bentobox/level/commands/island/IslandLevelCommand.java index 48314f9..58ada94 100644 --- a/src/main/java/world/bentobox/level/commands/island/IslandLevelCommand.java +++ b/src/main/java/world/bentobox/level/commands/island/IslandLevelCommand.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.UUID; import world.bentobox.bentobox.api.commands.CompositeCommand; +import world.bentobox.bentobox.api.localization.TextVariables; import world.bentobox.bentobox.api.user.User; import world.bentobox.level.Level; @@ -31,7 +32,7 @@ public class IslandLevelCommand extends CompositeCommand { // Convert name to a UUID final UUID playerUUID = getPlugin().getPlayers().getUUID(args.get(0)); if (playerUUID == null) { - user.sendMessage("general.errors.unknown-player"); + user.sendMessage("general.errors.unknown-player", TextVariables.NAME, args.get(0)); return true; } else if (user.getUniqueId().equals(playerUUID) ) { return this.calculateLevel(user);