Fixes the valid sign check not accounting for admin decryption prevention
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
This commit is contained in:
@@ -203,6 +203,8 @@ public class SignEventListener implements Listener {
|
||||
if (encryptedBook != null) {
|
||||
EncryptionUtil.markEncrypted(encryptedBook);
|
||||
player.getInventory().setItem(hand, encryptedBook);
|
||||
} else {
|
||||
new FormatBuilder(Translatable.ERROR_DECRYPT_FAILED).error(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,7 +338,10 @@ public class SignEventListener implements Listener {
|
||||
return false;
|
||||
}
|
||||
boolean isValid = !getPassword(lines).isBlank() && (lines[3].isBlank() ||
|
||||
EncryptionStyle.getFromString(getCleanLine(lines[3])) != null);
|
||||
((lines[3].contains(" ") &&
|
||||
EncryptionStyle.getFromString(getCleanLine(lines[3].split(" ")[0])) != null) ||
|
||||
EncryptionStyle.getFromString(getCleanLine(lines[3])) != null));
|
||||
|
||||
if (markSign) {
|
||||
if (isValid) {
|
||||
markLine(lines, 2, PASSWORD_COLOR);
|
||||
|
||||
Reference in New Issue
Block a user