From ce4bb8fe93a720988ae81606d5adb50938375c2a Mon Sep 17 00:00:00 2001 From: LexManos Date: Mon, 4 Apr 2016 15:44:03 -0700 Subject: [PATCH] Fix improper logic in ItemHandlerHelper.giveItemToPlayer causing some items to not be added. Closes #2705 --- src/main/java/net/minecraftforge/items/ItemHandlerHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraftforge/items/ItemHandlerHelper.java b/src/main/java/net/minecraftforge/items/ItemHandlerHelper.java index b2caf4717..9c1c32084 100644 --- a/src/main/java/net/minecraftforge/items/ItemHandlerHelper.java +++ b/src/main/java/net/minecraftforge/items/ItemHandlerHelper.java @@ -142,7 +142,7 @@ public class ItemHandlerHelper World world = player.worldObj; // try adding it into the inventory - ItemStack remainder = null; + ItemStack remainder = stack; // insert into preferred slot first if(preferredSlot >= 0) { @@ -151,7 +151,7 @@ public class ItemHandlerHelper // then into the inventory in general if(remainder != null) { - remainder = insertItemStacked(inventory, stack, false); + remainder = insertItemStacked(inventory, remainder, false); } // play sound if something got picked up