summaryrefslogtreecommitdiffstats
path: root/EssentialsSpawn/src/com
diff options
context:
space:
mode:
authorementalo <suror@gmx.co.uk>2011-12-07 01:12:36 +0000
committerementalo <suror@gmx.co.uk>2011-12-07 01:12:36 +0000
commit47f29cbe5d502cc01973f275928ebb9dca91bf9a (patch)
tree09ec5c50852306d099bf44edb8003dad0bdcdbfb /EssentialsSpawn/src/com
parent52d1de0ef89a7a0c0cde110464c831c99646cbfb (diff)
downloadEssentials-47f29cbe5d502cc01973f275928ebb9dca91bf9a.tar
Essentials-47f29cbe5d502cc01973f275928ebb9dca91bf9a.tar.gz
Essentials-47f29cbe5d502cc01973f275928ebb9dca91bf9a.tar.lz
Essentials-47f29cbe5d502cc01973f275928ebb9dca91bf9a.tar.xz
Essentials-47f29cbe5d502cc01973f275928ebb9dca91bf9a.zip
Catch TeleportClause.COMMAND in the teleport listener.
Changed Teleport methods to pass a TeleportClause param
Diffstat (limited to 'EssentialsSpawn/src/com')
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java7
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java3
2 files changed, 6 insertions, 4 deletions
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
index fe1630b4d..f29707b82 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
@@ -7,6 +7,7 @@ import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import static com.earth2me.essentials.I18n._;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandspawn extends EssentialsCommand
@@ -24,7 +25,7 @@ public class Commandspawn extends EssentialsCommand
if (args.length > 0 && user.isAuthorized("essentials.spawn.others"))
{
final User otherUser = getPlayer(server, args, 0);
- otherUser.getTeleport().respawn(charge);
+ otherUser.getTeleport().respawn(charge, TeleportCause.COMMAND);
if (!otherUser.equals(user))
{
otherUser.sendMessage(_("teleportAtoB", user.getDisplayName(), "spawn"));
@@ -33,7 +34,7 @@ public class Commandspawn extends EssentialsCommand
}
else
{
- user.getTeleport().respawn(charge);
+ user.getTeleport().respawn(charge, TeleportCause.COMMAND);
}
}
@@ -45,7 +46,7 @@ public class Commandspawn extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
final User user = getPlayer(server, args, 0);
- user.getTeleport().respawn(null);
+ user.getTeleport().respawn(null, TeleportCause.COMMAND);
user.sendMessage(_("teleportAtoB", user.getDisplayName(), "spawn"));
sender.sendMessage(_("teleporting"));
}
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
index 6bb453f12..8c3678a92 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
@@ -9,6 +9,7 @@ import org.bukkit.Location;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.event.player.PlayerRespawnEvent;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class EssentialsSpawnPlayerListener extends PlayerListener
@@ -84,7 +85,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
{
try
{
- user.getTeleport().now(spawns.getSpawn(ess.getSettings().getNewbieSpawn()), false);
+ user.getTeleport().now(spawns.getSpawn(ess.getSettings().getNewbieSpawn()), false, TeleportCause.PLUGIN);
}
catch (Exception ex)
{