Torchmaster

Torchmaster

64M Downloads

Division By Zero Error (and crash)

martindiv opened this issue ยท 1 comments

commented

Getting the following crash error:

This only occurs when trying to hover over the lit torch in an inventory and the game is attempting to produce the tool tip.

java.lang.ArithmeticException: / by zero
	at net.xalcon.torchmaster.common.items.ItemBlockMegaTorch.func_77624_a(ItemBlockMegaTorch.java:53)
	at net.minecraft.item.ItemStack.func_82840_a(ItemStack.java:605)
	at net.minecraft.client.gui.GuiScreen.func_146285_a(GuiScreen.java:137)
	at net.minecraft.client.gui.inventory.GuiContainer.func_73863_a(GuiContainer.java:170)
	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:382)
	at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1115)
	at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1077)
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:372)
	at net.minecraft.client.main.Main.main(SourceFile:124)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

Looking at ItemBlockMegaTorch.java shows:

int burnRate = TorchMasterMod.ConfigHandler.getMegaTorchBurnoutRate();
int ticksLeft = burnValueLeft / burnRate;

The configuration option "MegaTorchBurnoutRate has the following description:

"The speed at which the torch will extinguish. Set to 0 to disable. [range: 0 ~ 2147483647, default: 0] "
commented

Not sure how I overlooked this. Patch will be up on curse soon-ish (after curseforge checked the upload)
Thanks for the report!