PackagedExCrafting

PackagedExCrafting

4M Downloads

Crash when opening UI (divide by zero on getScaledProgress)

Kasama opened this issue ยท 1 comments

commented

Hello! First of all, thanks for the work on this mod, it definitely makes life easier when integrating AE and ExCrafting ๐Ÿ˜„

While playing Not too Complicated, which has this mod on it, I crashed while looking at an Ender Package Crafter while it was crafting some items.

The crash states that

java.lang.ArithmeticException: / by zero
	at thelm.packagedexcrafting.tile.EnderCrafterTile.getScaledProgress(EnderCrafterTile.java:256) ~[packagedexcrafting:2.0.0.3] {re:classloading}
	at thelm.packagedexcrafting.client.screen.EnderCrafterScreen.func_230450_a_(EnderCrafterScreen.java:28) ~[packagedexcrafting:2.0.0.3] {re:classloading}
	at net.minecraft.client.gui.screen.inventory.ContainerScreen.func_230430_a_(ContainerScreen.java:88) ~[?:?]
...

(full crash log here)

The crash points me to getScaledProgress which has a division. Probably an easy fix would be to add an if there to make sure that actualProgressReq isn't 0.

That might also be necessary on the other 6 implementations of getScaledProgress for the other machines.

commented

Should be fixed