diff options
author | ementalo <suror@gmx.co.uk> | 2011-12-07 01:12:36 +0000 |
---|---|---|
committer | ementalo <suror@gmx.co.uk> | 2011-12-07 01:12:36 +0000 |
commit | 10597cec2f3f70628e753616ff5371f65fa39f5f (patch) | |
tree | 86e3c2feb0432564f84f3f584a793ecbe54cce5c /EssentialsSpawn/src/com | |
parent | 854fc05c5b3a3d1d1ed40a0755eac401043b92b4 (diff) | |
download | Essentials-10597cec2f3f70628e753616ff5371f65fa39f5f.tar Essentials-10597cec2f3f70628e753616ff5371f65fa39f5f.tar.gz Essentials-10597cec2f3f70628e753616ff5371f65fa39f5f.tar.lz Essentials-10597cec2f3f70628e753616ff5371f65fa39f5f.tar.xz Essentials-10597cec2f3f70628e753616ff5371f65fa39f5f.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.java | 7 | ||||
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 3 |
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) { |