Powah Ender cell numeric clamping
GStefanowich opened this issue ยท 4 comments
Describe
The Powah mod makes it capable to store insane amounts of power, using Ender Cells
The Powah manual states that an Energy Cell can hold up to 9E of power (Still not sure what the unit of measurement E
is yet)
However, the mod compatibility seems to clamp the read energy stored as an int.
cell = peripheral.find("enderCell")
cell.getEnergy()
-- Returns "2147483647" (Max 32bit)
cell.getMaxEnergy()
-- Returns "2000000000000" >32 bit
As seen above though, the "MaxEnergy" is read correctly, at 2 trillion
I tested type(cell.getMaxEnergy())
if it was actually being handled as a string, but it does say number
.
Steps to reproduce
- Obtain an
Ender Cell
and 2xEnergy Cell (Nitro)
(Capable of storing 2B power each) - Place the Ender Cell, open the Ender Cell and shift click both Energy Cells inside (Setting capacity at 4B)
- Use a creative power source of some kind to fill the cell past 2.147B / 32-bit int (of 4B capacity)
- Use a ComputerCraft computer to attempt reading the current stored power
Multiplayer?
Yes
Version
1.20.1-0.7.40r (Latest 1.20.1)
Minecraft, Forge and maybe other related mods versions
NeoForge 47.1.101 Minecraft 1.20.1
Screenshots or Videos
No response
Crashlog/log
No response
hm fun, both of them should convert from long to double, not sure if this is powah's issue
CC-Tweaked provides a getEnergy
method for energy_storage
blocks. Is it possible that it's overriding AdvancedPeripherals implementation?
The energy_storage equivalent is an int.
Makes the following methods available:
enderCell
:getEnergy
getMaxEnergy
energy_storage
:getEnergy
getEnergyCapacity
I don't think there's a way I can call one specific implementation of it here.
I can open an issue over with CC:Tweaked instead, but I'm not sure how they'd fix it without also directly supporting Powahs Energy
class.
energy_storage
uses the Forge net.minecraftforge.energy.IEnergyStorage
, which is also an int.