Open
Description
Minecraft Version: 1.21.1
NeoForge Version: 21.1.141
Logs: N/A
Steps to Reproduce:
- Create a block entity that implements
Container
- Override
canTakeItem
and set up some sort of logic in it (or just make it return false) - Launch game, put items in the block and throw a hopper under it
- Observe as items are still removed from the block
Description of issue:
I assume this method is decently new, as only chiseled bookshelves and jukeboxes use it, but Container.canTakeItem
is not checked before doing any item extraction in InvWrapper.extractItem
. Both uses in vanilla code are fairly useless as it just checks that the target container has an available slot so I can see how this may have been missed. In my case, however, I don't want items to be extracted if a certain boolean property on the blockstate is set to true. I'm aware I could get around this by writing my own item hander instead of just using InvWrapper
, but I would honestly just rather use what's already provided :P