Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
pop4959 committed Sep 2, 2024
1 parent d3539b9 commit 030ceec
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,18 +284,20 @@ private LocketteProtection fromSignMessages(final CompoundTag sign) {
} else {
cleaned = message.replaceAll("\"", "");
}
final boolean privateHeader = cleaned.contains("[Private]");
final boolean moreUsersHeader = cleaned.contains("[More Users]");
final String cleanedNormalized = cleaned.toLowerCase();
final boolean privateHeader = cleanedNormalized.contains("[private]");
final boolean moreUsersHeader = cleanedNormalized.contains("[more users]");
if (privateHeader || moreUsersHeader) {
isValid = true;
hasPrivateHeader = privateHeader;
} else if (cleaned.contains("[Everyone]")) {
} else if (cleanedNormalized.contains("[everyone]")) {
isPublic = true;
} else if (cleaned.contains("[Redstone]")) {
} else if (cleanedNormalized.contains("[redstone]")) {
isRedstone = true;
} else if (cleaned.contains("Timer")) {
} else if (cleanedNormalized.contains("timer")) {
access.put(Source.of("door").toString(), "autoclose");
} else {
} else if (isValid) {
// Since this involves an expensive call to look up the user, only do this when a valid sign
UUID uuid;
final boolean isLocketteProFormat = cleaned.contains("#");
if (isLocketteProFormat) {
Expand Down

0 comments on commit 030ceec

Please sign in to comment.