rwtema / Extra-Utilities-2-Source

Sourcecode for Extra Utilities
Other
108 stars 75 forks source link

receivers.size() is able to be zero. #266

Open nerdass opened 5 years ago

nerdass commented 5 years ago

Line 115 of EnergyTransfer.java results in a divide by zero crash when receivers.size is zero.

The line in question is this one.

int transfer = Math.min(MAX_TRANSFER, totalEnergyAvailable) / receivers.size();

Crash log: https://pastebin.com/rYXCjYkJ

Version 1.9.8 on minecraft 1.12.2, this happened in the modpack FTB Revelation version 2.6.0 but the behavior could happen in any modpack if the abnormal state that led to receivers.size() being zero or null happens again.

The strange thing is there was /massive/ world corruption afterwards. Something took the overworld, and smashed it together with the end and the nether. Replacing the overworld with this weird amalgamation of all the other dimensions stacked on top of each other.