mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 11:45:19 +01:00
This commit is contained in:
parent
b02177e1d0
commit
dd9edb68b2
@ -286,6 +286,8 @@ permissions:
|
|||||||
default: false
|
default: false
|
||||||
plots.admin.command.clear:
|
plots.admin.command.clear:
|
||||||
default: false
|
default: false
|
||||||
|
plots.admin.flight:
|
||||||
|
default: false
|
||||||
|
|
||||||
plots.teleport.delay.bypass:
|
plots.teleport.delay.bypass:
|
||||||
default: false
|
default: false
|
||||||
@ -425,4 +427,4 @@ permissions:
|
|||||||
plots.save: true
|
plots.save: true
|
||||||
plots.done: true
|
plots.done: true
|
||||||
plots.continue: true
|
plots.continue: true
|
||||||
plots.middle: true
|
plots.middle: true
|
||||||
|
@ -186,15 +186,17 @@ public class PlotListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final FlyFlag.FlyStatus flyStatus = plot.getFlag(FlyFlag.class);
|
final FlyFlag.FlyStatus flyStatus = plot.getFlag(FlyFlag.class);
|
||||||
if (flyStatus != FlyFlag.FlyStatus.DEFAULT) {
|
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_FLIGHT)) {
|
||||||
boolean flight = player.getFlight();
|
if (flyStatus != FlyFlag.FlyStatus.DEFAULT) {
|
||||||
GameMode gamemode = player.getGameMode();
|
boolean flight = player.getFlight();
|
||||||
if (flight != (gamemode == GameModes.CREATIVE || gamemode == GameModes.SPECTATOR)) {
|
GameMode gamemode = player.getGameMode();
|
||||||
try (final MetaDataAccess<Boolean> metaDataAccess = player.accessPersistentMetaData(PlayerMetaDataKeys.PERSISTENT_FLIGHT)) {
|
if (flight != (gamemode == GameModes.CREATIVE || gamemode == GameModes.SPECTATOR)) {
|
||||||
metaDataAccess.set(player.getFlight());
|
try (final MetaDataAccess<Boolean> metaDataAccess = player.accessPersistentMetaData(PlayerMetaDataKeys.PERSISTENT_FLIGHT)) {
|
||||||
|
metaDataAccess.set(player.getFlight());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
player.setFlight(flyStatus == FlyFlag.FlyStatus.ENABLED);
|
||||||
}
|
}
|
||||||
player.setFlight(flyStatus == FlyFlag.FlyStatus.ENABLED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final GameMode gameMode = plot.getFlag(GamemodeFlag.class);
|
final GameMode gameMode = plot.getFlag(GamemodeFlag.class);
|
||||||
|
@ -201,7 +201,8 @@ public enum Permission {
|
|||||||
PERMISSION_ADMIN_BACKUP_OTHER("plots.admin.backup.other"),
|
PERMISSION_ADMIN_BACKUP_OTHER("plots.admin.backup.other"),
|
||||||
PERMISSION_ADMIN_ALLOW_UNSAFE("plots.admin.unsafe"),
|
PERMISSION_ADMIN_ALLOW_UNSAFE("plots.admin.unsafe"),
|
||||||
PERMISSION_ADMIN_DEBUG_OTHER("plots.admin.debug.other"),
|
PERMISSION_ADMIN_DEBUG_OTHER("plots.admin.debug.other"),
|
||||||
PERMISSION_RATE("plots.rate");
|
PERMISSION_RATE("plots.rate"),
|
||||||
|
PERMISSION_ADMIN_FLIGHT("plots.admin.flight");
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
|
||||||
private final String text;
|
private final String text;
|
||||||
|
Loading…
Reference in New Issue
Block a user