summaryrefslogtreecommitdiffstats
path: root/EssentialsSpawn
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2014-01-12 01:23:12 +0000
committerKHobbits <rob@khobbits.co.uk>2014-01-12 01:23:12 +0000
commitae5629ab2d3aada74425933ffffb1b4dc8bb29ac (patch)
treeffa50c883a2d5a5e50e0f5c38b769f17f72dc6a7 /EssentialsSpawn
parent31c027adf8ba84e0ebc790cf062e3f261eac7003 (diff)
downloadEssentials-ae5629ab2d3aada74425933ffffb1b4dc8bb29ac.tar
Essentials-ae5629ab2d3aada74425933ffffb1b4dc8bb29ac.tar.gz
Essentials-ae5629ab2d3aada74425933ffffb1b4dc8bb29ac.tar.lz
Essentials-ae5629ab2d3aada74425933ffffb1b4dc8bb29ac.tar.xz
Essentials-ae5629ab2d3aada74425933ffffb1b4dc8bb29ac.zip
Pass optional location parameters to teleport TL keys.
Diffstat (limited to 'EssentialsSpawn')
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java12
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);