forked from Upstream/mmocore
Permission to skip waypoint waiting time
This commit is contained in:
parent
441cea0208
commit
be82279540
@ -747,6 +747,7 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD
|
|||||||
final int y = getPlayer().getLocation().getBlockY();
|
final int y = getPlayer().getLocation().getBlockY();
|
||||||
final int z = getPlayer().getLocation().getBlockZ();
|
final int z = getPlayer().getLocation().getBlockZ();
|
||||||
final int warpTime = target.getWarpTime();
|
final int warpTime = target.getWarpTime();
|
||||||
|
final boolean hasPerm = getPlayer().hasPermission("mmocore.bypass-waypoint-wait");
|
||||||
int t;
|
int t;
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -759,7 +760,7 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD
|
|||||||
}
|
}
|
||||||
|
|
||||||
MMOCore.plugin.configManager.getSimpleMessage("warping-comencing", "left", String.valueOf((warpTime - t) / 20)).send(getPlayer());
|
MMOCore.plugin.configManager.getSimpleMessage("warping-comencing", "left", String.valueOf((warpTime - t) / 20)).send(getPlayer());
|
||||||
if (t++ >= warpTime) {
|
if (hasPerm || t++ >= warpTime) {
|
||||||
getPlayer().teleport(target.getLocation());
|
getPlayer().teleport(target.getLocation());
|
||||||
getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 20, 1, false, false));
|
getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 20, 1, false, false));
|
||||||
MMOCore.plugin.soundManager.getSound(SoundEvent.WARP_TELEPORT).playTo(getPlayer());
|
MMOCore.plugin.soundManager.getSound(SoundEvent.WARP_TELEPORT).playTo(getPlayer());
|
||||||
|
@ -24,6 +24,9 @@ permissions:
|
|||||||
mmocore.currency:
|
mmocore.currency:
|
||||||
description: Access to /deposit and /withdraw
|
description: Access to /deposit and /withdraw
|
||||||
default: op
|
default: op
|
||||||
|
mmocore.bypass-waypoint-wait:
|
||||||
|
description: Bypass waypoint waiting time
|
||||||
|
default: op
|
||||||
mmocore.class-select:
|
mmocore.class-select:
|
||||||
description: Access to /class
|
description: Access to /class
|
||||||
default: op
|
default: op
|
||||||
|
Loading…
Reference in New Issue
Block a user