From 47ae6f5378a3d5ad7d24927a1e7f75fb69dd4906 Mon Sep 17 00:00:00 2001 From: Kermina Awad Date: Fri, 11 Dec 2020 12:48:19 -0500 Subject: [PATCH] use getPlayerExact instead of getPlayer --- .../com/onarandombox/MultiverseCore/commands/CheckCommand.java | 2 +- .../com/onarandombox/MultiverseCore/commands/SpawnCommand.java | 2 +- .../onarandombox/MultiverseCore/commands/TeleportCommand.java | 2 +- .../MultiverseCore/destination/PlayerDestination.java | 2 +- .../onarandombox/MultiverseCore/listeners/MVPlayerListener.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java index 474308c6..34fa7791 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java @@ -37,7 +37,7 @@ public class CheckCommand extends MultiverseCommand { @Override public void runCommand(CommandSender sender, List args) { - Player p = this.plugin.getServer().getPlayer(args.get(0)); + Player p = this.plugin.getServer().getPlayerExact(args.get(0)); if (p == null) { sender.sendMessage("Could not find player " + ChatColor.GREEN + args.get(0)); sender.sendMessage("Are they online?"); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java index 5925d887..5536e76c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java @@ -50,7 +50,7 @@ public class SpawnCommand extends MultiverseCommand { sender.sendMessage("You don't have permission to teleport another player to spawn. (multiverse.core.spawn.other)"); return; } - Player target = this.plugin.getServer().getPlayer(args.get(0)); + Player target = this.plugin.getServer().getPlayerExact(args.get(0)); if (target != null) { target.sendMessage("Teleporting to this world's spawn..."); spawnAccurately(target); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java index 6f8264f4..e7e731c6 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java @@ -58,7 +58,7 @@ public class TeleportCommand extends MultiverseCommand { String destinationName; if (args.size() == 2) { - teleportee = this.plugin.getServer().getPlayer(args.get(0)); + teleportee = this.plugin.getServer().getPlayerExact(args.get(0)); if (teleportee == null) { this.messaging.sendMessage(sender, String.format("Sorry, I couldn't find player: %s%s", ChatColor.GOLD, args.get(0)), false); diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/PlayerDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/PlayerDestination.java index fb71c32c..0ca08f98 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/PlayerDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/PlayerDestination.java @@ -50,7 +50,7 @@ public class PlayerDestination implements MVDestination { */ @Override public Location getLocation(Entity e) { - Player p = plugin.getServer().getPlayer(this.player); + Player p = plugin.getServer().getPlayerExact(this.player); Player plLoc = null; if (e instanceof Player) { plLoc = (Player) e; diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java index 40c1f51b..10c2e585 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java @@ -169,7 +169,7 @@ public class MVPlayerListener implements Listener { this.plugin.log(Level.FINER, "We know the teleporter is the console! Magical!"); teleporter = this.plugin.getServer().getConsoleSender(); } else { - teleporter = this.plugin.getServer().getPlayer(teleporterName); + teleporter = this.plugin.getServer().getPlayerExact(teleporterName); } } this.plugin.log(Level.FINER, "Inferred sender '" + teleporter + "' from name '"