Charging energy items doesn't update mutated stack
raoulvdberge opened this issue ยท 1 comments
Describe the bug
Charging RS items in a Charge-O-Mat does nothing.
Steps to Reproduce
Steps to reproduce the behavior:
Put an (empty) RS Portable Grid in a Charge-O-Mat.
Environment (please complete the following information with the version):
- Minecraft: 1.21.1
- Mod Loader: Fabric
- TechReborn: 5.11.11
Additional context
The issue is that the item is never charging
So I've been stepping through the code, the item does end up charged but the energy handler at RS side always retrieves a new ItemStack
So I checked the code here: https://github.com/TechReborn/TechReborn/blob/1.21/RebornCore/src/main/java/reborncore/common/powerSystem/PowerAcceptorBlockEntity.java#L192
And I think the issue is that you never "update" the slot with the mutated stack
The flow should be Create container item context -> Call energy handler to charge -> Update the inventory slot with the mutated stack
The container item context is immutable IIRC so changes never get propagated to the backing inventory
This was a Refined Storage issue, we were not using the container item context properly.
Fixed in refinedmods/refinedstorage2#741