Browse Source

PTP now has a 30 second cooldown from when you were last hurt

nossr50 13 years ago
parent
commit
a40d3f5f9c
2 changed files with 7 additions and 0 deletions
  1. 1 0
      Changelog.txt
  2. 6 0
      src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java

+ 1 - 0
Changelog.txt

@@ -24,6 +24,7 @@ Version 2.0.00-dev
  = Fixed bug where Green Terra didn't work on Stone Brick
  = Fixed bug where Tree Feller could be used without permissions
  = Fixed exploit where falling sand & gravel weren't tracked
+ ! Changed PTP to prevent teleporting if you've been hurt in the last 30 seconds
  ! Changed Chimera Wing failure check to use the maxWorldHeight.
  ! Changed inspect failed message to say inspect rather than whois
  ! Changed Call of the Wild to activate on left-click rather than right-click

+ 6 - 0
src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java

@@ -42,6 +42,12 @@ public class PtpCommand implements CommandExecutor {
 		    return true;
 		}
 		
+		if(PP.getRecentlyHurt()+30*1000 > System.currentTimeMillis())
+		{
+		    player.sendMessage("You've been hurt in the last 30 seconds and cannnot teleport.");
+		    return true;
+		}
+		
 		if (args.length < 1) {
 			player.sendMessage(ChatColor.RED + "Usage is /ptp <playername>");
 			return true;