Permission to skip waypoint waiting time

This commit is contained in:
Jules 2023-06-25 02:22:50 +02:00
parent 441cea0208
commit be82279540
2 changed files with 7 additions and 3 deletions

View File

@ -353,7 +353,7 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD
/**
* @return If the item is unlocked by the player
* This is used for skills that can be locked & unlocked.
* This is used for skills that can be locked & unlocked.
*/
public boolean hasUnlocked(Unlockable unlockable) {
return unlockable.isUnlockedByDefault() || unlockedItems.contains(unlockable.getUnlockNamespacedKey());
@ -747,6 +747,7 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD
final int y = getPlayer().getLocation().getBlockY();
final int z = getPlayer().getLocation().getBlockZ();
final int warpTime = target.getWarpTime();
final boolean hasPerm = getPlayer().hasPermission("mmocore.bypass-waypoint-wait");
int t;
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());
if (t++ >= warpTime) {
if (hasPerm || t++ >= warpTime) {
getPlayer().teleport(target.getLocation());
getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 20, 1, false, false));
MMOCore.plugin.soundManager.getSound(SoundEvent.WARP_TELEPORT).playTo(getPlayer());
@ -1191,7 +1192,7 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD
* checks if they could potentially upgrade to one of these
*
* @return If the player can change its current class to
* a subclass
* a subclass
*/
@Deprecated
public boolean canChooseSubclass() {

View File

@ -24,6 +24,9 @@ permissions:
mmocore.currency:
description: Access to /deposit and /withdraw
default: op
mmocore.bypass-waypoint-wait:
description: Bypass waypoint waiting time
default: op
mmocore.class-select:
description: Access to /class
default: op