Fix hopper extract behavior being broken on edge cases due to IItemHandler capability. Closes #3062

This commit is contained in:
LexManos committed 2016-07-03 13:45:26 -07:00
1 parent f58d1cae1a
commit 3e6099055e
2 files changed
+9 -8

No files matched your search

@@ -32,13 +32,13 @@ import net.minecraft.world.World;
public class VanillaInventoryCodeHooks
{
public static boolean extractHook(IHopper dest)
//Return: Null if we did nothing {no IItemHandler}, True if we moved an item, False if we moved no items
public static Boolean extractHook(IHopper dest)
{
TileEntity tileEntity = dest.getWorld().getTileEntity(new BlockPos(dest.getXPos(), dest.getYPos() + 1, dest.getZPos()));
if (tileEntity == null || !tileEntity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN))
return false;
return null;
IItemHandler handler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN);
@@ -67,7 +67,7 @@ public class VanillaInventoryCodeHooks
}
}
return true;
return false;
}
public static boolean dropperInsertHook(World world, BlockPos pos, TileEntityDispenser dropper, int slot, ItemStack stack)