mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-08-31 00:20:34 +02:00
Add set "none" command as an alternative to unset
This commit is contained in:
parent
79f24a5944
commit
385aa6d438
|
@ -196,7 +196,6 @@ public class CommandManager {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
String s = args.get(2).toLowerCase();
|
||||
switch (s) {
|
||||
// Provide aliases
|
||||
|
@ -295,6 +294,20 @@ public class CommandManager {
|
|||
args.add(2, "meta");
|
||||
break;
|
||||
}
|
||||
|
||||
// Provide lazy set rewrite
|
||||
boolean lazySet = (
|
||||
args.size() >= 6 &&
|
||||
args.get(2).equalsIgnoreCase("permission") &&
|
||||
args.get(3).toLowerCase().startsWith("set") &&
|
||||
(args.get(5).equalsIgnoreCase("none") || args.get(5).equalsIgnoreCase("0"))
|
||||
);
|
||||
|
||||
if (lazySet) {
|
||||
args.remove(5);
|
||||
args.remove(3);
|
||||
args.add(3, "unset");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user