mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Set the item in the current hand instead of the current slot
Should close #324
This commit is contained in:
parent
4231bbf557
commit
95ca15cd1a
2 changed files with 3 additions and 3 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue