From eee18f40be775091ad6930a08dd95664a1f06227 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 12 Jan 2014 01:23:12 +0000 Subject: Pass optional location parameters to teleport TL keys. --- .../src/com/earth2me/essentials/spawn/Commandspawn.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'EssentialsSpawn/src/com/earth2me') diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java index 2317e774c..cccce4284 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java @@ -28,16 +28,15 @@ public class Commandspawn extends EssentialsCommand if (args.length > 0 && user.isAuthorized("essentials.spawn.others")) { final User otherUser = getPlayer(server, user, args, 0); - respawn(user, otherUser, charge); + respawn(user.getSource(), user, otherUser, charge); if (!otherUser.equals(user)) { otherUser.sendMessage(_("teleportAtoB", user.getDisplayName(), "spawn")); - user.sendMessage(_("teleporting")); } } else { - respawn(user, user, charge); + respawn(user.getSource(), user, user, charge); } throw new NoChargeException(); } @@ -50,15 +49,16 @@ public class Commandspawn extends EssentialsCommand throw new NotEnoughArgumentsException(); } final User user = getPlayer(server, args, 0, true, false); - respawn(null, user, null); + respawn(sender, null, user, null); user.sendMessage(_("teleportAtoB", Console.NAME, "spawn")); - sender.sendMessage(_("teleporting")); + } - private void respawn(final User teleportOwner, final User teleportee, final Trade charge) throws Exception + private void respawn(final CommandSource sender, final User teleportOwner, final User teleportee, final Trade charge) throws Exception { final SpawnStorage spawns = (SpawnStorage)this.module; final Location spawn = spawns.getSpawn(teleportee.getGroup()); + sender.sendMessage(_("teleporting", spawn.getWorld().getName(), spawn.getBlockX(), spawn.getBlockY(), spawn.getBlockZ())); if (teleportOwner == null) { teleportee.getTeleport().now(spawn, false, TeleportCause.COMMAND); -- cgit v1.2.3