mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2024-11-25 12:45:48 +01:00
Allow default flags to be removed in claim tab by admins.
This commit is contained in:
parent
973c45d1ee
commit
d6b2958580
@ -1147,11 +1147,13 @@ private Consumer<CommandSender> createFlagConsumer(GDPermissionUser src, GDClaim
|
||||
// Check server context
|
||||
final Iterator<Context> iterator = newContexts.iterator();
|
||||
boolean hasServerContext = false;
|
||||
boolean hasDefaultContext = false;
|
||||
while (iterator.hasNext()) {
|
||||
final Context context = iterator.next();
|
||||
if (context.getKey().equals("server")) {
|
||||
hasServerContext = true;
|
||||
break;
|
||||
} else if (context.getKey().equalsIgnoreCase("gd_claim_default")) {
|
||||
hasDefaultContext = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1166,7 +1168,7 @@ private Consumer<CommandSender> createFlagConsumer(GDPermissionUser src, GDClaim
|
||||
return;
|
||||
}
|
||||
|
||||
if (displayType == MenuType.DEFAULT) {
|
||||
if (displayType == MenuType.DEFAULT || (hasDefaultContext && src.getInternalPlayerData().canManageFlagDefaults)) {
|
||||
PermissionResult result = PermissionUtil.getInstance().setTransientPermission(this.subject, flag.getPermission(), newValue, newContexts);
|
||||
if (result.successful()) {
|
||||
showFlagPermissions(src, claim, displayType);
|
||||
|
@ -1147,11 +1147,13 @@ private Consumer<CommandSource> createFlagConsumer(GDPermissionUser src, GDClaim
|
||||
// Check server context
|
||||
final Iterator<Context> iterator = newContexts.iterator();
|
||||
boolean hasServerContext = false;
|
||||
boolean hasDefaultContext = false;
|
||||
while (iterator.hasNext()) {
|
||||
final Context context = iterator.next();
|
||||
if (context.getKey().equals("server")) {
|
||||
hasServerContext = true;
|
||||
break;
|
||||
} else if (context.getKey().equalsIgnoreCase("gd_claim_default")) {
|
||||
hasDefaultContext = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1166,7 +1168,7 @@ private Consumer<CommandSource> createFlagConsumer(GDPermissionUser src, GDClaim
|
||||
return;
|
||||
}
|
||||
|
||||
if (displayType == MenuType.DEFAULT) {
|
||||
if (displayType == MenuType.DEFAULT || (hasDefaultContext && src.getInternalPlayerData().canManageFlagDefaults)) {
|
||||
PermissionResult result = PermissionUtil.getInstance().setTransientPermission(this.subject, flag.getPermission(), newValue, newContexts);
|
||||
if (result.successful()) {
|
||||
showFlagPermissions(src, claim, displayType);
|
||||
|
Loading…
Reference in New Issue
Block a user