Draconic Evolution

Draconic Evolution

77M Downloads

Problem with the AutoFeederHelmet mod

canitzp opened this issue ยท 6 comments

commented

Base information

  • Minecraft version: 1.12.2
  • Mod version: 2.3.27.353
  • Minecraft Forge version: any

I recently got an issue, where a user told me that my mod "AutoFeederHelmet" doesn't work with the Wyvern Helmet. My mod adds a feeding module, wich can be crafted together with any helmet, to add the autofeeding capability. The problem here, the feeding module does damage or if possible extracts energy from the carrier helmet. When applied to the Wyvern helmet it doesn't work, since the extractEnery method returns 0 all the time. This leads to the feeding module thinking the helmet energy is empty.

The fix for this problem would be to add the proper exract energy code to the helmet or change som things completly. The feeding module just uses the provided energy capability.

commented

The reason why it's 0 all the time is because energy is not meant to be extracted from it. You're not supposed to be able to use it to power anything else.

Still, I understand what you're trying to do, and maybe this can be done a little easier.

commented

Yeah normally a only energy consuming item (like a piece of armor) should not be able to "give" it's storage to other items, but using the capability is the only thing I can image to get the energy needed for the feeder module in the first place. The extract method just can't differentiate the way we wanna use it.
If you have any idea on how to change it, let me know.

commented

Do what my mod (Draconic Additions) does and directly manipulate the energy values.

If the regular method returns 0, check if the "energy" NBT tag exists. If so, directly pull out the energy if it's greater than or equal to the energy you require.

commented

This in fact would work and I've done it before, but it just feels so hacky todo

commented

If not Draconic Evolution, other mods would also probably do the same. Might as well code for it, even if it's hacky. That's why I did it :P

commented

I added the NBT manipulation for extracting energy now.