aurilisdev / Electrodynamics

Electrodynamics is a mod that brings realistic, world-based science and technology into Minecraft along with some other additions.
https://aurilis.dev/electrodynamics/
Other
73 stars 17 forks source link

Electric item changes: swap battery correctly and remove all but one use of `ElectricItemProperties#capacity` #275

Open 9thCore opened 2 weeks ago

9thCore commented 2 weeks ago

The capacity can now be changed by the current holding battery, just as long as both voltages (receiving and extraction) match. It's now also correctly handled from other angles, such as the charger or stacks' durability bars, by calling IItemElectric#getMaximumCapacity instead of accessing ElectricItemProperties#capacity directly. (changes to CreativeTabSupplier#addCreativeModeItems are technically not needed and unecessary overhead, but its better to have consistency, i do think)

While this may not be immediately beneficial to the base mod, I do believe that addons looking to add other types of battery (same voltage as base mod, different capacities) would be helped.

This is on a different branch so as to not come packaged with the patches in the other PR, in case these changes turn out to be undesired.