mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +01:00
fix MetaStackElement equality checks
This commit is contained in:
parent
fb171a57c2
commit
2fd74f3b7e
@ -47,24 +47,28 @@ import java.util.UUID;
|
||||
*/
|
||||
@UtilityClass
|
||||
public class StandardStackElements {
|
||||
private static final HighestPriority HIGHEST_PRIORITY = new HighestPriority();
|
||||
private static final LowestPriority LOWEST_PRIORITY = new LowestPriority();
|
||||
private static final HighestPriorityOwn HIGHEST_PRIORITY_OWN = new HighestPriorityOwn();
|
||||
private static final LowestPriorityOwn LOWEST_PRIORITY_OWN = new LowestPriorityOwn();
|
||||
|
||||
public static Optional<MetaStackElement> parseFromString(LuckPermsPlugin plugin, String s) {
|
||||
s = s.toLowerCase();
|
||||
|
||||
if (s.equals("highest")) {
|
||||
return Optional.of(new HighestPriority());
|
||||
return Optional.of(HIGHEST_PRIORITY);
|
||||
}
|
||||
|
||||
if (s.equals("lowest")) {
|
||||
return Optional.of(new LowestPriority());
|
||||
return Optional.of(LOWEST_PRIORITY);
|
||||
}
|
||||
|
||||
if (s.equals("highest_own")) {
|
||||
return Optional.of(new HighestPriorityOwn());
|
||||
return Optional.of(HIGHEST_PRIORITY_OWN);
|
||||
}
|
||||
|
||||
if (s.equals("lowest_own")) {
|
||||
return Optional.of(new LowestPriorityOwn());
|
||||
return Optional.of(LOWEST_PRIORITY_OWN);
|
||||
}
|
||||
|
||||
if (s.startsWith("highest_on_track_") && s.length() > "highest_on_track_".length()) {
|
||||
|
Loading…
Reference in New Issue
Block a user