Simple Wired Charger compatibility
Snownee opened this issue ยท 6 comments
Issue Description:
Hello, I wrote a simple Forge energy handler (here) that allows item get repaired if being charged. As the getMaxEnergyStored()
always returns 0, and this line of codes, the item can never be charged. So I am wondering what we can do to let things work?
Affected Versions):
- EnderIO: 5.1.52
- Minecraft: 1.12.2
This appears to be an issue with your item. You're telling the charger that the item can't store any energy; so what's the charger to do?
@Ommina I think it does not have energy stored does not mean it can not receive energy. Received energy will be directly converted to durability, so returning 0 makes sense
I dunno. I get your point, but it seems to me this is how any sane item charger (wireless or otherwise) would behave.
"Hi!" says the charger. "How much energy can you store?"
"None at all!" says the item.
"Ah."
Now, you argue that your item is not actually interested in buffering any energy; you just want to consume what is offered as it arrives. And I get your logic, but I really feel you'll be swimming upstream here. Even if the fine people in EnderIO-land buy the argument, I expect you'll just run into the same issue with other mod's chargers.
It runs into the "max stored" check here, but that's not all. If we didn't use that to determine charging speed, it would fail at the "are you full already" check and would be ejected instantly. Or crash the game if some machine wants to show (0 / 0 * 100) + "%"
charging state.
My recommendation is to calculate all those values from the durability and max durability of the item.