Essentials

Essentials

4M Downloads

[1.14.4] Hoppers cannot extract items from minecarts

HyCraftHD opened this issue · 4 comments

commented

The high throughput hopper cannot extract items from a hopper minecart / hopper chest entity. It doesn't matter if its on a rail or not.

The vanilla hopper uses the method getInventoryAtPosition in HopperTileEntity to search for adjacent inventories. This method also include entity inventories that support minecarts as show here:

if (iinventory == null) {
         List<Entity> list = worldIn.getEntitiesInAABBexcluding((Entity)null, new AxisAlignedBB(x - 0.5D, y - 0.5D, z - 0.5D, x + 0.5D, y + 0.5D, z + 0.5D), EntityPredicates.HAS_INVENTORY);
         if (!list.isEmpty()) {
            iinventory = (IInventory)list.get(worldIn.rand.nextInt(list.size()));
         }
      }

EDIT:
I have made a pull request that implements this logic

commented

Closes in PR 21

commented

Any chance for a build on curseforge soon?

commented

Done! https://www.curseforge.com/minecraft/mc-mods/essentials/files/2818382
Thanks for reminding me, I had meant to wait 2 days after the initial PR to merge it with any other bugfixes that popped up, and it completely slipped my mind :)

commented

Thank you very much! Keep up the good work!