From ef3d76fb9f1e6270d679d46c9153bae4a752b5db Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 27 Mar 2012 23:04:00 -0400 Subject: [PATCH] Fixed bug where you could TP to dead players --- Changelog.txt | 2 ++ .../java/com/gmail/nossr50/commands/party/PtpCommand.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index 34e78e33a..f1863d20c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -17,6 +17,8 @@ Version 1.3.04-dev = Fixed Green Terra & Super Breaker awarding 4x drops at high levels. = Fixed summoned ocelots never changing skins. = Fixed bug with Disarm not working + = Fixed some API functions not being visible + = Fixed bug where /ptp worked on dead party members ! Changed MySQL to reload all player information on reconnection ! Changed event package structure - be sure to update these if you're using the API in your plugin diff --git a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java index e42ed863a..81671c8be 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java @@ -64,6 +64,11 @@ public class PtpCommand implements CommandExecutor { Player target = plugin.getServer().getPlayer(args[0]); PlayerProfile PPt = Users.getProfile(target); + if (target.isDead()) { + player.sendMessage(ChatColor.RED + "You can't teleport to dead players."); //TODO: Needs more locale. + return true; + } + if (PP.getParty().equals(PPt.getParty())) { McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(player, target, PP.getParty()); Bukkit.getPluginManager().callEvent(event);