Sueta

Books without Borders Updated

1.4.2

Easy book management

·Plugin

Books without Borders Updated

This is a rewrite of the Books Without Borders plugin. This rewrite used the source code given at the original bukkit page.
This version has been cleaned up, commented, updated for 1.20 and updated for Java 17. All depreciated code has been updated. As the original author gave the source code away, this new version is licensed under the GPLv3. It should be compatible with old config files and books. The /bwb prefix has been removed and several commands have changed to make use of spigot's built-in help and tab-completion systems. Some additional features have been added.

Books without Borders Updated!
Ever wanted to export your book to a text file? Ever want to import it back in? Accidentally sign it too soon? If so, Books without Borders has got your back!

Features:

  • Export written books and book and quills to .txt or .yml files
  • Import books from files as written books or unsigned books
  • Text files can be any length, and the import process fits the content to the correct page length
  • Books can be saved privately, or to a directory visible server wide
  • Encrypt books to prevent other players from reading them, optionally using real AES encryption to hide contents from anyone with access to server files as well.
  • Give, encrypt, or decrypt held books with signs
  • Give players books via command blocks
  • Unsign or copy held books with a simple command
  • Give first time players a single book or a set of books when they join
  • Configurable option to require certain items or pay via Vault compatible economy to create books via command
  • Add lore to any item with a simple command
  • Supports adding and saving color to title, lore, and book contents
  • Color and formatting codes can be manually turned into formatting using /formatbook
  • Clear a book, and start anew with /clearbook
  • Formatting and color codes can be turned into formatting once any book is signed. This is enabled through a config value
  • Change generation of books. Create tattered books for your RPG server!
  • Optionally, make it impossible to duplicate the original version of a book
  • Optionally, hit a bookshelf while sneaking to display the contained books. The bookshelf can be given a title and lore with /setBookshelfData
  • Easily add a title page or chapter page (for an unsigned book, you can add a blank page as well) with `/addBookTitlePage`.
  • If the necessary options are enabled, books can be truly encrypted with the AES cipher, making them impossible to decrypt without knowing the password. Even admin decryption can be made useless. Only enable if you are aware of the potential loss caused by forgotten passwords!
  • Remove extra blank pages or unneeded chapter pages with /deleteBookPage
  • 1.4.0+ Stores the player that signed a book as a persistent UUID value, allowing the book author to be changed for a book without breaking author restrictions. This does not affect books signed before 1.4.0.
  • 1.4.0+ Stores encryption info as persistent values, preventing dual encryption or decryption of unencrypted books.
  • 1.4.0+ Tracks the number of encrypted books in existence, to make sure the file for an encrypted book is deleted when the last known copy is decrypted or unsigned.
  • 1.4.0+ Stores encrypted files using UUIDs, preventing the previous name conflictions. This means a book can be encrypted with 10 different passwords and given to 10 different players without any issues.

Group encryption

  • Group encryption allows every player with the bookswithoutborders.decrypt.<group> permission to decrypt the encrypted book. The encryption password for group encryption is only used for scrambing the contents. A player with the permission simply needs to right-click with the encrypted book in their hand.


Commands:

An in-game description of available commands is available through the /bwb command. Note that all commands also have an alias starting with bwb, like bwbClear, bwbFormat, etc.

  • /addbooktitlepage [page index] [title~description] - Used to add a page with the title and author of a book at the front of a book, at a custom page number or adding a custom title or title and description at a specific page (chapter pages, for example).
  • /bookswithoutborders [command] - Displays information about commands (and permissions if the user has bookswithoutborders.admin). Specify a command for a more detailed usage description.
  • /copybook <# of copies> - Copies the book the player is holding
  • /createbwbsign <give/encrypt/decrypt> [book identifier/password [encryption style] [disable admin decryption] - Create a BwB plugin sign without sign length restrictions. Useful to create give signs for books with long titles without relying on book ids.
  • /decryptbook <key> - Decrypts the book the player is holding. "key" is required and MUST be IDENTICAL to the key used to encrypt the held book
  • /deletebook <file name or number> - Deletes the specified file in the player's directory
  • /deletepublicbook <file name or number> - Same as deletebook, but deletes files in the public directory
  • /encryptbook <key> [encryption style] - Encrypts the book the player is holding. "key" is required and can be any phrase or number excluding spaces. "style" is not required. Possible style values are "dna", "substitution", "aes", "onetimepad" or "magic". If real encryption is enabled, only AES can be chosen.
  • /groupencryptbook <group name> <key> [encryption style] [overwrite (true/false)] - Encrypts a book for players with the "decrypt.<group name>" permission. The key is only used for scrambling the contents, and style only affects how the book looks, though that's only visible to players without the permission. Supplying true as the fourth argument will overwrite the group encrypted book. This will affect contents for every player right-clicking to decrypt the book after the book was overwritten.
  • /editbwbconfig <option> [value] [value] - Used to check or set the value of a configuration option.
  • /formatbook - Formats the held written book (converts color and formatting codes to the corresponding formatted text)
  • /givebook <file name or number> <playername> [# of copies (num)] [signed (true/false)] - Gives the selected player a book from your personal directory
  • /givepublicbook <file name or number> <playername> [# of copies (num)] [signed (true/false)] - Same as givebook, but uses books from the public directory
  • /loadbook <file name or number> [# of copies] [signed (true/false)] - Creates a book from the specified file and gives it to the player. If no file is specified, a list of available files is returned. If true is specified, the book will be signed, if false it will be unsigned
  • /loadpublicbook <file name or number> [# of copies] [signed (true/false)] - Same as loadbook, but views files in the public directory
  • /migratebooks - Migrates books to the new format which allows spaces in a book's file name. It will also change the title-author separator for all saved books.
  • /reload - Reloads BwB's configuration file
  • /savebook [overwrite (true/false)] - Saves the book the player is holding to a text file in a private directory. If true is specified, a book of the same name by the same author will be overwritten by the new book
  • /savepublicbook [overwrite (true/false)] - Same as savebook, but saves files in the public directory
  • /searchbooks <title/author/fullname> <RegEx expression> - Lists books in a player's own directory matching the search. The listed books can be clicked to copy the full path.
  • /searchpublicbooks <title/author/fullname> <RegEx expression> - Same as searchbooks, but for searching through publicly saved books.
  • /setbookauthor <author> - Sets the author of the book the player is holding
  • /setbookgeneration <generation> - Sets the generation of the held book (ORIGINAL, COPY_OF_ORIGINAL, COPY_OF_COPY, TATTERED)
  • /setlore [new lore] - Sets the lore of the item the player is holding. Insert the lore_line_separator character to force a new line ("~" by default). If used with no arguments, current lore is removed.
  • /settitle [title] [set display name (true/false)] - Sets the title of the book/item the player is holding. If used with no arguments, the current display name is removed. If a "true" argument is added, a book's display name can be changed instead of its title.
  • /unsignbook - Un-signs the book the player is holding
  • /clearbook - Removes all text from the held un-signed book
  • /setBookshelfData <delete/name/lore> <text> [more text] - Sets the name/lore for a bookshelf which is shown when peeking at its contents.

/editbwbconfig examples

  • Note that the current and default values are displayed if using /bwbConfig <option> without a new value.

Setting book price:

  • /bwbConfig economy 5 Sets the cost for book creation to 5 of whichever currency is used.
  • /bwbConfig bookPrice item 1 Sets the cost for book creation to 1 of whichever item is in your main hand.
  • /bwbConfig bookPrice clear Clear the book price to make book printing free.

Setting first join books and message:

  • /bwbConfig firstJoinBooks KnarCraft Guide¤EpicKnarvik97 Sets first join books to the book KnarCraft Guide¤EpicKnarvik97.
  • /bwbConfig firstJoinBooks KnarCraft Guide¤EpicKnarvik97|Welcome¤Notch Sets first join books to the books KnarCraft Guide¤EpicKnarvik97 and Welcome¤Notch. Note the | character.
  • /bwbConfig firstJoinBooks clear Clear the list of first-join books.
  • /bwbConfig firstJoinMessage Welcome, new player! Sets first join message to Welcome, new player!.
  • /bwbConfig firstJoinMessage clear Clears the first join message, setting it to an empty string.

Setting separators: (note that separators must be a single character)

  • /bwbConfig titleAuthorSeparator ¤ Sets the title-author separator to the character ¤
  • /bwbConfig loreSeparator ~ Sets the lore-line separator to the character ~.

Most other options are just toggles used like this:

  • /bwbConfig <option> true Enables the option.
  • /bwbConfig <option> false Disables the option.

Permissions:

Permission collections:

  • bookswithoutborders.* - Alias for bookswithoutborders.admin
  • bookswithoutborders.admin - Grants all permissions
  • bookswithoutborders.use - Allows player to use commands to save/load/delete in their personal directory, searching through books in their personal directory, and peeking at bookshelves if enabled
  • bookswithoutborders.alterbooks - Allows player to change books' data such as lore/title/author/generation/formatting and unsigning books, adding title pages, deleting book pages, as well as setting bookshelf data. Permission is only given to set title and lore for signed books.
  • bookswithoutborders.settitle.* - Allows player to set the title/display name of any book/item. (does not bypass author modify restrictions)
  • bookswithoutborders.setlore.* - Allows player to set the lore of any book/item. (does not bypass author modify restrictions)

Single permissions:

  • bookswithoutborders.reload - Allows player to reload this plugin
  • bookswithoutborders.format - Allows a player to format a book
  • bookswithoutborders.save - Allows a player to save books to their personal directory
  • bookswithoutborders.load - Allows player to load books from their personal directory
  • bookswithoutborders.delete - Allows player to delete books from their personal directory
  • bookswithoutborders.unsign - Allows player to un-sign books
  • bookswithoutborders.copy - Allows player to copy books
  • bookswithoutborders.loadpublic - Allows player to load from the public directory
  • bookswithoutborders.savepublic - Allows player to save to the public directory
  • bookswithoutborders.encrypt - Allows player to encrypt books
  • bookswithoutborders.groupencrypt - Allows player to use group-based encryption
  • bookswithoutborders.decrypt - Allows player to decrypt books
  • bookswithoutborders.decrypt.agroup - Allows player to decrypt books group-encrypted for group "agroup"
  • bookswithoutborders.signs - Allows player to create signs that give/encrypt/decrypt books
  • bookswithoutborders.give - Allows player to give another player one of their privately saved books
  • bookswithoutborders.givepublic - Allows a player to give another player a book from the public directory
  • bookswithoutborders.settitle.books - Allows player to set the title of the currently held signed book
  • bookswithoutborders.settitle.items - Allows player to set the title of the currently held non-book item
  • bookswithoutborders.setauthor - Allows player to set the author of the currently held book
  • bookswithoutborders.setlore.books - Allows player to set the lore of the currently held signed book
  • bookswithoutborders.setlore.items - Allows player to set the lore of the currently held non-book item
  • bookswithoutborders.bypassauthoronlycopy - Allows player to ignore authorRestricted.copy config setting
  • bookswithoutborders.bypassauthoronlyunsign - Allows player to ignore authorRestricted.unsign config setting
  • bookswithoutborders.bypassauthoronlysave - Allows player to ignore authorRestricted.save config setting
  • bookswithoutborders.bypassauthoronlymodify - Allows player to ignore authorRestricted.modify config setting.
  • bookswithoutborders.bypassbookprice - Allows player to ignore bookPrice config setting
  • bookswithoutborders-setbookprice - Allows player to set the cost of creating a book
  • bookswithoutborders.setgeneration - Allows player to change the generation of a book (Original, Copy, Copy of Copy)
  • bookswithoutborders.clear - Allows player to clear the contents of the held writable book
  • bookswithoutborders.peekbookshelf - Allows player to left-click a bookshelf to see the contents of the shelf
  • bookswithoutborders.editbookshelf - Allows player to set name/lore for bookshelves, used for peeking
  • bookswithoutborders.addtitlepage - Allows player to add title pages or chapter pages to books.
  • bookswithoutborders.deletepage - Allows player to delete pages from a book
  • bookswithoutborders.preventadmindecryption - Allows player to toggle the prevention of admin decryption if the option encryption.allowAdminBypassBlocking is enabled.
  • bookswithoutborders.searchbooks - Allows player to search through their saved books.
  • bookswithoutborders.searchpublicbooks - Allows player to search through the publicly saved collection of books.

Signs:

This plugin supports several custom signs with special functionality. Each plugin sign must have [BwB] on its first line.
It is recommended to use the / createbwbsign command over manual creation for give signs, as it bypasses the text
limit, and specifying books by index is really unstable. If you have some other plugin for editing sign lines, you can
first specify the visual text on the sign's third and fourth line, then add a `:` and put the full book path after that.

Give sign

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

Configuration options:

Similar projects

Plugin →