diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index f6cf5a46..e9f657f8 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -43,6 +43,7 @@ body: - 1.21.1-1.2.1 - 1.21.1-1.3.0 - 1.21.1-1.3.1 + - 1.21.1-1.3.2 validations: required: true - type: input diff --git a/changelog.md b/changelog.md index 5860b647..c44884b3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,3 @@ # Fixes -- Fix a dupe issue with the slotted book +- Fix a dupe issue with the slotted book (again) diff --git a/gradle.properties b/gradle.properties index 95a36cea..029f4723 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ org.gradle.configuration-cache=true mod.group=com.github.minecraftschurlimods mod.id=bibliocraft -mod.version=1.3.1 +mod.version=1.3.2 mod.name=Bibliocraft Legacy mod.vendor=MinecraftschurliMods mod.authors=IchHabeHunger54, Minecraftschurli diff --git a/src/main/java/com/github/minecraftschurlimods/bibliocraft/content/slottedbook/SlottedBookItem.java b/src/main/java/com/github/minecraftschurlimods/bibliocraft/content/slottedbook/SlottedBookItem.java index 15ebb389..d22040dc 100644 --- a/src/main/java/com/github/minecraftschurlimods/bibliocraft/content/slottedbook/SlottedBookItem.java +++ b/src/main/java/com/github/minecraftschurlimods/bibliocraft/content/slottedbook/SlottedBookItem.java @@ -23,7 +23,7 @@ public boolean isFoil(ItemStack stack) { public InteractionResultHolder use(Level level, Player player, InteractionHand usedHand) { if (level.isClientSide()) return InteractionResultHolder.success(player.getItemInHand(usedHand)); if (player instanceof ServerPlayer sp) { - sp.openMenu(new SimpleMenuProvider((id, inv, p) -> new SlottedBookMenu(id, inv, p.getItemInHand(usedHand)), getDescription()), buf -> buf.writeEnum(usedHand)); + sp.openMenu(new SimpleMenuProvider((id, inv, p) -> new SlottedBookMenu(id, inv, usedHand), getDescription()), buf -> buf.writeEnum(usedHand)); } return InteractionResultHolder.consume(player.getItemInHand(usedHand)); } diff --git a/src/main/java/com/github/minecraftschurlimods/bibliocraft/content/slottedbook/SlottedBookMenu.java b/src/main/java/com/github/minecraftschurlimods/bibliocraft/content/slottedbook/SlottedBookMenu.java index 01b28b4c..f5d09a0c 100644 --- a/src/main/java/com/github/minecraftschurlimods/bibliocraft/content/slottedbook/SlottedBookMenu.java +++ b/src/main/java/com/github/minecraftschurlimods/bibliocraft/content/slottedbook/SlottedBookMenu.java @@ -12,8 +12,12 @@ import net.minecraft.world.item.ItemStack; public class SlottedBookMenu extends AbstractContainerMenu { - public SlottedBookMenu(int id, Inventory inventory, ItemStack stack) { + private final InteractionHand hand; + + public SlottedBookMenu(int id, Inventory inventory, InteractionHand hand) { super(BCMenus.SLOTTED_BOOK.get(), id); + this.hand = hand; + ItemStack stack = inventory.player.getItemInHand(hand); Container container = new SlottedBookContainer(stack); addSlot(new SlottedBookSlot(container, 0, 80, 34)); for (int i = 0; i < 3; i++) { @@ -36,7 +40,7 @@ public SlottedBookMenu(int id, Inventory inventory, ItemStack stack) { } public SlottedBookMenu(int id, Inventory inventory, FriendlyByteBuf buf) { - this(id, inventory, inventory.player.getItemInHand(buf.readEnum(InteractionHand.class))); + this(id, inventory, buf.readEnum(InteractionHand.class)); } @Override @@ -75,7 +79,7 @@ public ItemStack quickMoveStack(Player player, int index) { @Override public boolean stillValid(Player player) { - return true; + return player.getItemInHand(hand).is(BCItems.SLOTTED_BOOK.get()); } private static class ReadOnlySlot extends Slot { diff --git a/summary.txt b/summary.txt index 309f7780..303eee4d 100644 --- a/summary.txt +++ b/summary.txt @@ -1 +1 @@ -Fix a dupe bug \ No newline at end of file +Fix a dupe bug (again) \ No newline at end of file