4 Commits
1.2.2 ... 1.2.3

4 changed files with 7 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.knarcraft</groupId>
<artifactId>BooksWithoutBorders</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
<packaging>jar</packaging>
<licenses>
@ -75,7 +75,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<version>1.19.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -51,7 +51,7 @@ public class CommandSave implements TabExecutor {
}
ItemSlot holdingSlot = InventoryHelper.getHeldSlotBook(player, false, false, false, false);
if (holdingSlot != ItemSlot.NONE) {
if (holdingSlot != null && holdingSlot != ItemSlot.NONE) {
ItemStack holdingItem = InventoryHelper.getHeldItem(player, holdingSlot == ItemSlot.MAIN_HAND);
boolean duplicate = args.length == 1 && Boolean.parseBoolean(args[0]);
saveBook(player, holdingItem, duplicate, savePublic);

View File

@ -89,6 +89,9 @@ public class SignEventListener implements Listener {
return;
}
ItemStack heldItem = playerInventory.getItem(hand);
if (heldItem == null) {
return;
}
Material heldItemType = heldItem.getType();
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && (Tag.SIGNS.isTagged(clickedBlockType) ||

View File

@ -96,7 +96,7 @@ public final class InventoryHelper {
if (state == BookHoldingState.SIGNED_BOTH_HANDS ||
state == BookHoldingState.UNSIGNED_BOTH_HANDS ||
state == BookHoldingState.NONE) {
return null;
return ItemSlot.NONE;
}
if (handMatters && typeMatters) {
if (mainHand && mainHandItem.getType() == requiredMaterial) {