From c4d81aea1bc2d9056fa3cbc8bb5c75ec051eb122 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Mon, 11 Mar 2024 14:58:38 -0500 Subject: [PATCH] Fixed Crafter on a stick --- .../actuallyadditions/mod/items/ItemCrafterOnAStick.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java index 6c3aef5c4..4e7a2fea7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java @@ -17,6 +17,7 @@ import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.SimpleMenuProvider; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.ContainerLevelAccess; import net.minecraft.world.inventory.CraftingMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -34,7 +35,12 @@ public class ItemCrafterOnAStick extends ItemBase { @Override public InteractionResultHolder use(Level world, @Nonnull Player player, @Nonnull InteractionHand hand) { if (!world.isClientSide) { - player.openMenu(new SimpleMenuProvider((windowId, playerInventory, playerEntity) -> new CraftingMenu(windowId, playerInventory), CONTAINER_TITLE)); + player.openMenu(new SimpleMenuProvider((windowId, playerInventory, playerEntity) -> new CraftingMenu(windowId, playerInventory, ContainerLevelAccess.create(world, player.blockPosition())){ + @Override + public boolean stillValid(Player playerIn) { + return true; + } + }, CONTAINER_TITLE)); } return new InteractionResultHolder<>(InteractionResult.SUCCESS, player.getItemInHand(hand)); }