From 1158820f97e60a4dbfec7aa67789bf32919fb5de Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 23 Jun 2023 18:10:45 +0200 Subject: [PATCH] Fixes some issues Fixes the API version being read incorrectly by Paper Fixes the check for missing title or author for a book in a bookshelf --- .../bookswithoutborders/listener/BookshelfListener.java | 4 ++-- src/main/resources/plugin.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/knarcraft/bookswithoutborders/listener/BookshelfListener.java b/src/main/java/net/knarcraft/bookswithoutborders/listener/BookshelfListener.java index da082a5..f14c2c0 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/listener/BookshelfListener.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/listener/BookshelfListener.java @@ -83,12 +83,12 @@ public class BookshelfListener implements Listener { private String getBookDescription(BookMeta bookMeta) { String title; String author; - if (!bookMeta.hasTitle()) { + if (!bookMeta.hasTitle() || bookMeta.getTitle() == null) { title = "Untitled"; } else { title = bookMeta.getTitle(); } - if (!bookMeta.hasAuthor()) { + if (!bookMeta.hasAuthor() || bookMeta.getAuthor() == null) { author = "Unknown"; } else { author = bookMeta.getAuthor(); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 97fca58..4e9d9d0 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,10 +1,10 @@ name: BooksWithoutBorders version: '${project.version}' main: net.knarcraft.bookswithoutborders.BooksWithoutBorders -api-version: 1.20 -prefix: Books Without Borders +api-version: '1.20' +prefix: 'Books Without Borders' authors: [ EpicKnarvik97, AkiraAkiba ] -description: A continuation of the original Books Without Borders +description: 'A continuation of the original Books Without Borders' softdepend: [ Vault ] website: https://www.spigotmc.org/resources/books-without-borders-updated.96069/ dev-url: https://git.knarcraft.net/EpicKnarvik97/Books-Without-Borders