From c6c018ee8845137f49732be1e2dfe9951515a2c5 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Thu, 11 Aug 2022 01:14:50 +0200 Subject: [PATCH] Adds permission to bypass author only save --- .../net/knarcraft/bookswithoutborders/command/CommandSave.java | 3 ++- src/main/resources/plugin.yml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSave.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSave.java index 06cfebb..7a527d3 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSave.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSave.java @@ -78,7 +78,8 @@ public class CommandSave implements TabExecutor { //Only allow saving of own books if enabled if (BooksWithoutBordersConfig.getAuthorOnlySave() && !saveToPublicFolder && - BookHelper.isNotAuthor(player, book)) { + (!player.hasPermission("bookswithoutborders.bypassAuthorOnlySave") && + BookHelper.isNotAuthor(player, book))) { return; } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 7167bd7..771948f 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -116,6 +116,7 @@ permissions: bookswithoutborders.givepublic: true bookswithoutborders.bypassauthoronlycopy: true bookswithoutborders.bypassauthoronlyunsign: true + bookswithoutborders.bypassauthoronlysave: true bookswithoutborders.bypassbookprice: true bookswithoutborders.setbookprice: true bookswithoutborders.reload: true @@ -173,6 +174,8 @@ permissions: description: Allows player to ignore Author_Only_Copy config setting bookswithoutborders.bypassauthoronlyunsign: description: Allows player to ignore Author_Only_Unsign config setting + bookswithoutborders.bypassauthoronlysave: + description: Allows player to ignore Author_Only_Save config setting bookswithoutborders.bypassbookprice: description: Allows player to ignore Price_to_create_book config setting bookswithoutborders.setbookprice: