Adds info about the encrypt and decrypt signs, and fixes a bug in group decryption
This commit is contained in:
parent
931be7a61b
commit
1d3c50aab1
11
README.md
11
README.md
@ -37,3 +37,14 @@ The **_give_** sign must have **[Give]** on its second line.
|
||||
The third and fourth line contains the book to be loaded.
|
||||
This can either be a numerical id pointing to a publicly saved book,
|
||||
or the full text identifier of the book (book name, author).
|
||||
|
||||
#### Encrypt sign
|
||||
|
||||
The **_encrypt_** sign must have **[Encrypt]** on its second line.
|
||||
The third line must contain the encryption key
|
||||
The fourth line can be empty or contain "dna" for dna-based encryption.
|
||||
|
||||
#### Decrypt sign
|
||||
|
||||
The **_decrypt_** sign must have **[Decrypt]** on its second line.
|
||||
The third line must contain the decryption key
|
@ -388,7 +388,7 @@ public class BooksWithoutBorders extends JavaPlugin {
|
||||
file = FileHelper.getBookFile(getBookFolder() + fileName);
|
||||
} else if (dir.equalsIgnoreCase("player")) {
|
||||
file = FileHelper.getBookFile(getBookFolder() + cleanString(sender.getName()) + getSlash() + fileName);
|
||||
} else if (dir.trim().isEmpty()) {
|
||||
} else if (!dir.trim().isEmpty()) {
|
||||
file = FileHelper.getBookFile(getBookFolder() + "Encrypted" + getSlash() + dir + getSlash() + fileName);
|
||||
} else {
|
||||
file = null;
|
||||
|
@ -254,6 +254,10 @@ public class SignEventListener implements Listener {
|
||||
}
|
||||
newBook = BooksWithoutBorders.getInstance().loadBook(player, fileName, "true", groupName, heldItem.getAmount());
|
||||
|
||||
if (newBook == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
player.getInventory().setItem(hand, newBook);
|
||||
player.closeInventory();
|
||||
player.sendMessage(ChatColor.GREEN + "Book auto-decrypted!");
|
||||
|
Loading…
Reference in New Issue
Block a user