Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charging energy items doesn't update mutated stack #105

Open
raoulvdberge opened this issue Oct 11, 2024 · 0 comments
Open

Charging energy items doesn't update mutated stack #105

raoulvdberge opened this issue Oct 11, 2024 · 0 comments

Comments

@raoulvdberge
Copy link

Issue description

Charging Refined Storage items in a Portable Energy Storage does nothing.

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/Rearth/Oritech/blob/1.21/src/main/java/rearth/oritech/block/base/entity/ExpandableEnergyStorageBlockEntity.java#L145
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

TechReborn is suffering from the same problem: TechReborn/TechReborn#3302

Steps to reproduce

  1. Place a Portable Energy Storage
  2. Place an empty Portable Grid from Refined Storage into the Portable Energy Storage
  3. Notice that it isn't charging

Minecraft version

1.21.1 (Latest)

Fabric loader version

0.16.0

Fabric API version

0.102.0+1.21.1

Oritech version

0.9.1

Other relevant versions

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant