mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2025-02-18 02:11:23 +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
|
// Check server context
|
||||||
final Iterator<Context> iterator = newContexts.iterator();
|
final Iterator<Context> iterator = newContexts.iterator();
|
||||||
boolean hasServerContext = false;
|
boolean hasServerContext = false;
|
||||||
|
boolean hasDefaultContext = false;
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
final Context context = iterator.next();
|
final Context context = iterator.next();
|
||||||
if (context.getKey().equals("server")) {
|
if (context.getKey().equals("server")) {
|
||||||
hasServerContext = true;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayType == MenuType.DEFAULT) {
|
if (displayType == MenuType.DEFAULT || (hasDefaultContext && src.getInternalPlayerData().canManageFlagDefaults)) {
|
||||||
PermissionResult result = PermissionUtil.getInstance().setTransientPermission(this.subject, flag.getPermission(), newValue, newContexts);
|
PermissionResult result = PermissionUtil.getInstance().setTransientPermission(this.subject, flag.getPermission(), newValue, newContexts);
|
||||||
if (result.successful()) {
|
if (result.successful()) {
|
||||||
showFlagPermissions(src, claim, displayType);
|
showFlagPermissions(src, claim, displayType);
|
||||||
|
@ -1147,11 +1147,13 @@ private Consumer<CommandSource> createFlagConsumer(GDPermissionUser src, GDClaim
|
|||||||
// Check server context
|
// Check server context
|
||||||
final Iterator<Context> iterator = newContexts.iterator();
|
final Iterator<Context> iterator = newContexts.iterator();
|
||||||
boolean hasServerContext = false;
|
boolean hasServerContext = false;
|
||||||
|
boolean hasDefaultContext = false;
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
final Context context = iterator.next();
|
final Context context = iterator.next();
|
||||||
if (context.getKey().equals("server")) {
|
if (context.getKey().equals("server")) {
|
||||||
hasServerContext = true;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayType == MenuType.DEFAULT) {
|
if (displayType == MenuType.DEFAULT || (hasDefaultContext && src.getInternalPlayerData().canManageFlagDefaults)) {
|
||||||
PermissionResult result = PermissionUtil.getInstance().setTransientPermission(this.subject, flag.getPermission(), newValue, newContexts);
|
PermissionResult result = PermissionUtil.getInstance().setTransientPermission(this.subject, flag.getPermission(), newValue, newContexts);
|
||||||
if (result.successful()) {
|
if (result.successful()) {
|
||||||
showFlagPermissions(src, claim, displayType);
|
showFlagPermissions(src, claim, displayType);
|
||||||
|
Loading…
Reference in New Issue
Block a user