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

[Bug]: Collection of Energy API issues #39

Open
5 tasks done
Rearth opened this issue Nov 18, 2024 · 0 comments
Open
5 tasks done

[Bug]: Collection of Energy API issues #39

Rearth opened this issue Nov 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Rearth
Copy link

Rearth commented Nov 18, 2024

Bug Description

Hi, so I've done some testing of the item handling with CSL in 1.21 (on both fabric and neoforge) and found a few issues (assuming I implemented things correctly, if not please let me know):
On Fabric:

  • Using TransferUtil.moveValue removes all other changed components on an item class implementing EnergyProvider.Item. Items from other mods (e.g. tech reborn, energized power) work fine (no isses/warnings in the logs)
  • Using the energy items from CSL in charging slots from other mods (e.g. tech reborn, energized power) crashes the game (crash log: https://mclo.gs/QNXO03J)

On Neoforge:

  • Charging items works fine using TransferUtil.moveValue, no data components are lost (with csl energy items). However energy items from another mod are not detected as energy items
  • Charging the csl energy items works fine with storage containers from other mods

The energy transfer behaviour implementation (from block behaviour to item) can be found here: https://github.com/Rearth/Oritech/blob/1.21/common/src/main/java/rearth/oritech/block/base/entity/ExpandableEnergyStorageBlockEntity.java#L123
and then item implementation here: https://github.com/Rearth/Oritech/blob/1.21/common/src/main/java/rearth/oritech/item/tools/util/OritechEnergyItem.java#L95

I recorded this behaviour to make it easier to see what's happening here:

Fabric (recording ends with the crash above):
https://github.com/user-attachments/assets/0896a815-0b01-4ff3-9f96-834c20076132

Neoforge:
https://github.com/user-attachments/assets/160bd51e-ee87-4710-bf05-e75086f12317

How to Reproduce?

Use oritech with any of these mods (or I guess loading the CSL testmod with any of the mentioned mods and testing it there should also yield the same results) and proceed as shown in the videos.

Expected Behavior

Energy to be transferred without other data components being lost. The energy transfer behaviour should work with both items implementing csl energyprovider and other mods.

Version

0.0.6 (self-built, but this stuff wasn't touched)

Mod Loader Version

1.21.1 - 0.16.9

Mod Loader

N/A

Logs or additional context

No idea if this issue also occurs with the other APIs, such as fluid, item or energy containers, as Oritech only uses the energy part.

Code of Conduct

  • I have searched the issue tracker and confirmed that the issue has not been reported
  • I have checked the FAQ (if one is present) and my issue is not listed
  • I have verified that I am using the latest version of the mod
  • I have verified that I have installed all the required dependencies for the mod
  • I have verified that I do not have Optifine installed. We will close issues if we detect Optifine is in your pack. We cannot fix Optifine issues. Please do not report issues with Optifine present.
@Rearth Rearth added the bug Something isn't working label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant