Golden Hoppers

Golden Hoppers

1M Downloads

GoldenHopperBlockEntity is duplicating behavior that vanilla interfaces provide

2No2Name opened this issue ยท 3 comments

commented

GoldenHopperBlockEntity seems to be incompatible with my hopper optimizations mod (see 2No2Name/hopperOptimizations#23 ).
I think it would be best to make GoldenHopperBlockEntity use vanilla's SidedInventory::canInsert (refer to the shulker box not accepting shulker boxes code to see how it can work) to define which items can be inserted into the slots of the Golden Hopper.
I will work on making hopper optimizations compatible with a HopperBlockEntity subclass that implements SidedInventory::canInsert, which should in total, fix the compatibility issues.

commented

Thank you, I also changed it in hopper optimizations now. A minor problem when testing that i noticed is that the hopper does not realize that the filter item is being changed. If you call BlockEntity::resetBlock (This clears some cached data in my mod.) when changing the filter item that would be fixed too, but I think that is only a minor problem anyways.

commented

Wouldn't the same problem happen with /data block modify, which also only uses markDirty?

commented

Yes it probably will, so I might have to hook into markDirty as well. Thanks
edit: No it won't. The problem here is that there is some hidden state in the blockentity that is not the inventory or the blockstate but still influences the behavior of the inventory.