mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-10-15 21:16:00 +00:00
New permission: essentials.teleport.timer.move - allow players to move during tp delay
This commit is contained in:
parent
3083ba2627
commit
872bc4df4c
|
@ -95,17 +95,17 @@ public class Teleport implements Runnable, ITeleport
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Math.round(teleportUser.getLocation().getX() * MOVE_CONSTANT) != initX
|
if (!user.isAuthorized("essentials.teleport.timer.move")
|
||||||
|| Math.round(teleportUser.getLocation().getY() * MOVE_CONSTANT) != initY
|
&& (Math.round(teleportUser.getLocation().getX() * MOVE_CONSTANT) != initX
|
||||||
|| Math.round(teleportUser.getLocation().getZ() * MOVE_CONSTANT) != initZ
|
|| Math.round(teleportUser.getLocation().getY() * MOVE_CONSTANT) != initY
|
||||||
|| teleportUser.getHealth() < health)
|
|| Math.round(teleportUser.getLocation().getZ() * MOVE_CONSTANT) != initZ
|
||||||
{ // user moved, cancel teleport
|
|| teleportUser.getHealth() < health))
|
||||||
|
{
|
||||||
|
// user moved, cancel teleport
|
||||||
cancel(true);
|
cancel(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
health = teleportUser.getHealth(); // in case user healed, then later gets injured
|
health = teleportUser.getHealth(); // in case user healed, then later gets injured
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
if (now > started + delay)
|
if (now > started + delay)
|
||||||
{
|
{
|
||||||
|
@ -302,7 +302,8 @@ public class Teleport implements Runnable, ITeleport
|
||||||
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
|
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void warnUser(final IUser user) {
|
private void warnUser(final IUser user)
|
||||||
|
{
|
||||||
Calendar c = new GregorianCalendar();
|
Calendar c = new GregorianCalendar();
|
||||||
c.add(Calendar.SECOND, (int)delay);
|
c.add(Calendar.SECOND, (int)delay);
|
||||||
c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
|
c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
|
||||||
|
|
Loading…
Reference in a new issue