GregTechCEu / GregTech

GregTech CE 1.12 fork continuing progression and development
GNU Lesser General Public License v3.0
255 stars 176 forks source link

ArithmeticException: / by zero in ItemNetHandler #2645

Open ccressent opened 1 month ago

ccressent commented 1 month ago

GregTech CEu Version

2.8.10-beta

Modpack Used

Nomifactory-CEu-1.7

Addons Installed

No response

Environment

Singleplayer

Side Crashed

Server

New Worlds

No

Steps to Reproduce

Unknown. I was not doing anything when this happened.

Crash Report

Full crash report here: crash-2024-10-21_16.06.51-server.txt.

Additional Information

I am not a Java developer, nor am I familiar with the inner workings of GregTech CEu, but the ArithmeticException comes from here: https://github.com/GregTechCEu/GregTech/blob/v2.8.10/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetHandler.java#L271

It seems to me that, maybe in extremely rare cases, transferredCopy.size() can be 0. The code should probably handle that.