From 95ca15cd1a897d16b08409b09d5d4370d340693f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 17 Nov 2016 16:31:05 +0100 Subject: [PATCH] Set the item in the current hand instead of the current slot Should close #324 --- .../mod/blocks/BlockAtomicReconstructor.java | 2 +- .../de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java index 874195225..1c97be5a0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -88,7 +88,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud else{ ItemStack slot = reconstructor.getStackInSlot(0); if(StackUtil.isValid(slot)){ - player.inventory.setInventorySlotContents(player.inventory.currentItem, slot.copy()); + player.setHeldItem(hand, slot.copy()); reconstructor.setInventorySlotContents(0, StackUtil.getNull()); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java index 28f9b1910..45df9cabb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java @@ -117,7 +117,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{ } else{ if(!StackUtil.isValid(stackPlayer)){ - player.inventory.setInventorySlotContents(player.inventory.currentItem, slot.copy()); + player.setHeldItem(hand, slot.copy()); compost.setInventorySlotContents(0, null); return true; } @@ -125,7 +125,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{ int addedStackSize = Math.min(StackUtil.getStackSize(slot), stackPlayer.getMaxStackSize()-StackUtil.getStackSize(stackPlayer)); ItemStack stackToAdd = stackPlayer.copy(); stackToAdd = StackUtil.addStackSize(stackToAdd, addedStackSize); - player.inventory.setInventorySlotContents(player.inventory.currentItem, stackToAdd); + player.setHeldItem(hand, stackToAdd); compost.decrStackSize(0, addedStackSize); return true;