Removed teleport from PlayerSession.

This commit is contained in:
Simon Rigby 2011-03-01 16:10:28 +00:00
parent a91991551c
commit 7d9060879c

View File

@ -28,14 +28,22 @@ public class MVPlayerSession {
} }
/** /**
* Teleport the Player to the destination as long as enough time has passed since the last teleport. * Update the Teleport time.
* @param location
*/ */
public void teleport(Location location){ public void teleport(){
this.teleportLast = (new Date()).getTime();
}
/**
* Grab whether the cooldown on Portal use has expired or not.
* @return
*/
public boolean getTeleportable(){
Long time = (new Date()).getTime(); Long time = (new Date()).getTime();
if ((time - this.teleportLast) > config.getInt("portalcooldown", 5000)) { if ((time - this.teleportLast) > config.getInt("portalcooldown", 5000)) {
this.player.teleportTo(location); return true;
this.teleportLast = time; } else {
return false;
} }
} }