diff --git a/common/src/main/java/me/lucko/luckperms/common/metastacking/StandardStackElements.java b/common/src/main/java/me/lucko/luckperms/common/metastacking/StandardStackElements.java index 5b846f2d..e090f9d7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/metastacking/StandardStackElements.java +++ b/common/src/main/java/me/lucko/luckperms/common/metastacking/StandardStackElements.java @@ -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 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()) {