PTP exploit fix

This commit is contained in:
nossr50 2012-03-08 18:00:43 -08:00
parent d0f66ece98
commit 8669582e8f
2 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,7 @@ Version 2.0.00-dev
= Fixed issue where every block broken had a mining check applied
= Fixed issue where every block broken had a herbalism check applied
= Fixed issue where blocks weren't being removed from the watchlist
= Fixed exploit where you could use /ptp to teleport to anyone
! Changed inspect failed message to say inspect rather than whois
! Changed Call of the Wild to activate on left-click rather than right-click
! Changed Blast Mining to track based on Entity ID vs. Location

View File

@ -34,10 +34,17 @@ public class PtpCommand implements CommandExecutor {
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
if(PP.getParty() == null || PP.getParty() == "")
{
player.sendMessage(ChatColor.RED+"You are not in a party!");
return true;
}
if (args.length < 1) {
player.sendMessage(ChatColor.RED + "Usage is /ptp <playername>");
return true;
}
if (plugin.getServer().getPlayer(args[0]) == null) {
player.sendMessage("That is not a valid player");
}
@ -49,6 +56,8 @@ public class PtpCommand implements CommandExecutor {
player.teleport(target);
player.sendMessage(ChatColor.GREEN + "You have teleported to " + target.getName());
target.sendMessage(ChatColor.GREEN + player.getName() + " has teleported to you.");
} else {
player.sendMessage(ChatColor.RED + "That player is in a different party than you.");
}
}