diff options
author | KHobbits <rob@khobbits.co.uk> | 2014-01-12 01:23:12 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2014-01-12 01:23:12 +0000 |
commit | eee18f40be775091ad6930a08dd95664a1f06227 (patch) | |
tree | 938a11f8b0e4872a19e9b3f0ca2cb1feecbcdde9 /EssentialsSpawn | |
parent | 4084445b5bbc728fb90bdf9562e224cd49c4032c (diff) | |
download | Essentials-eee18f40be775091ad6930a08dd95664a1f06227.tar Essentials-eee18f40be775091ad6930a08dd95664a1f06227.tar.gz Essentials-eee18f40be775091ad6930a08dd95664a1f06227.tar.lz Essentials-eee18f40be775091ad6930a08dd95664a1f06227.tar.xz Essentials-eee18f40be775091ad6930a08dd95664a1f06227.zip |
Pass optional location parameters to teleport TL keys.
Diffstat (limited to 'EssentialsSpawn')
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java | 12 |
1 files changed, 6 insertions, 6 deletions
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); |