Skip to content

Commit

Permalink
Fix Backpack Crafting when stacksize not 1
Browse files Browse the repository at this point in the history
  • Loading branch information
hammy275 committed May 8, 2022
1 parent 3b0d613 commit cbdaba4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ public static void onHitboxInteract(PlayerEntity player, BackpackInfo info, int
Network.INSTANCE.sendToServer(new InventorySwapPacket(slot + 9));
Swap.handleInventorySwap(player, slot + 9, Hand.MAIN_HAND); // Do swap on both sides
} else if (slot <= 30) {
info.craftingInput[slot - 27] = player.getItemInHand(Hand.MAIN_HAND);
info.craftingInput[slot - 27] = player.getItemInHand(Hand.MAIN_HAND).copy();
if (!info.craftingInput[slot - 27].isEmpty()) info.craftingInput[slot - 27].setCount(1);
Network.INSTANCE.sendToServer(new CraftPacket(info.craftingInput, player.blockPosition(),
true));
} else if (slot == 31) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/blf02/immersivemc/server/swap/Swap.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ protected static boolean removeNeededIngredients(ServerPlayerEntity player, Craf
if (player.isCreative()) return true; // Always succeed if in creative mode

NonNullList<ItemStack> toRemoves = NonNullList.create();
for (int i = 0; i < 9; i++) {
for (int i = 0; i < inv.getHeight() * inv.getWidth(); i++) {
toRemoves.add(inv.getItem(i));
}

Expand Down

0 comments on commit cbdaba4

Please sign in to comment.