From 28b7849ff54ea242d571ec052f094f0f5398d2fa Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 4 Nov 2022 03:05:30 +0100 Subject: [PATCH] Tries to fix #9 Sets the amount of books to the same amount as the old book --- .../knarcraft/bookswithoutborders/command/CommandUnSign.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandUnSign.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandUnSign.java index a6936fd..34fb317 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandUnSign.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandUnSign.java @@ -50,6 +50,7 @@ public class CommandUnSign implements TabExecutor { public void unSignHeldBook(Player player, boolean mainHand) { //Get the old book BookMeta oldBook = InventoryHelper.getHeldBookMetadata(player, mainHand); + ItemStack heldBook = InventoryHelper.getHeldBook(player, mainHand); //Only allow the owner to un-sign the book if (BooksWithoutBordersConfig.getAuthorOnlyUnsign() && !player.hasPermission("bookswithoutborders.bypassAuthorOnlyUnsign")) { @@ -60,6 +61,7 @@ public class CommandUnSign implements TabExecutor { //UnSign the book ItemStack newBook = new ItemStack(Material.WRITABLE_BOOK); + newBook.setAmount(heldBook.getAmount()); newBook.setItemMeta(oldBook); InventoryHelper.replaceHeldItem(player, newBook, mainHand);