Gas-Burning Generator Crash
grimuars opened this issue ยท 16 comments
When i connect Electrolytic Separator and Gas-Burning Generator with pressurised tubes and then right-clicking on generator, i have this crash:
Time: 9/16/14 7:51 AM
Description: Rendering screen
java.lang.ArithmeticException: / by zero
at mekanism.client.gui.GuiGasGauge.getScaledLevel(GuiGasGauge.java:36)
at mekanism.client.gui.GuiGauge.renderScale(GuiGauge.java:58)
at mekanism.client.gui.GuiGauge.renderBackground(GuiGauge.java:50)
at mekanism.client.gui.GuiMekanism.func_146976_a(GuiMekanism.java:117)
at mekanism.generators.client.gui.GuiGasGenerator.func_146976_a(GuiGasGenerator.java:79)
at net.minecraft.client.gui.inventory.GuiContainer.func_73863_a(GuiContainer.java:78)
at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1352)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:990)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:273)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:363)
at org.multimc.EntryPoint.listen(EntryPoint.java:165)
at org.multimc.EntryPoint.main(EntryPoint.java:54)
If I click on unconnected generator, all is well.
Mekanism-1.7.10-7.1.1.104
Thanks!
See #1819
#1819 isn't a fix.
Here is a complete pastebin logfile:
http://pastebin.com/PNar8xKz
It seems, that in the latest version:
- new ones also don't work
- also connected gas pipe at the front side and then this crash occurs
I've also had this crash on several of my players worlds mostly in regards to the gas pipes.
Here is a live stream where Ani crash doing this if you want to see. It is SSP. http://www.twitch.tv/annemunition/b/569297290 The crash is at the 1 hour 56 min mark (or around there) Just before the two hour mark.
I get the same "division by 0" error when I put a Gas Tank full of Ethylene on Gas-Burning Generator slot too.
I'm playing on Bevo's Tech Pack 10-3 FULL. (Mekanism-1.7.10-7.1.1.104)
Crash report:
http://pastebin.com/y75TBrNk
I can confirm this issue. If I craft one in survival mode it crashes instantly when right clicked. But when I take one out in creative mode it runs fine without any issues.
Oops, looks like the issue's still there then. I'll see if I can fix it properly.
It doesn't seem to matter what type of gas pipe. At first I thought it was EnderIO's gas pipes, but the div by 0 happens with Mekanism's native gas pipes, too.
Could this be a server-side issue? I can't seem to reproduce it in SP, but can do it reliably in my private MP server. There's also info spat out by the server console after the crash:
[10:26:46] [Netty IO #2/ERROR] [FML]: NetworkDispatcher exception
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:1.7.0_67]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:1.7.0_67]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[?:1.7.0_67]
at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.7.0_67]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) ~[?:1.7.0_67]
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:436) ~[UnpooledUnsafeDirectByteBuf.class:?]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:870) ~[AbstractByteBuf.class:?]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:208) ~[NioSocketChannel.class:?]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:87) [AbstractNioByteChannel$NioByteUnsafe.class:?]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [SingleThreadEventExecutor$2.class:?]
at java.lang.Thread.run(Thread.java:745) [?:1.7.0_67]
I traced down the problem to a NBT not properly written. In TileEntityGasGenerator.java
getMaxGas()
returns the correct value of 18000
but in GuiGasGenerator
it returns 0.
Because I have very little knowledge about internal structures and processes I can't really make a PR. But I tried to change a bit in the code to get an idea. I changed line 179 in ItemBlockGenerator.java from ((ISustainedData)tileEntity).readSustainedData(stack);
to
((ISustainedData)tileEntity).writeSustainedData(stack);
and after placing a Gas-Burning Generator it works out of the box and the NBT is written. It works for other machines as well, and a bit of testing with different variations did not showed up any errors or crashes.
Maybe someone has a better idea...
Regards.
I've finally fixed this for good, I think. Build 110. Was an issue with trying to read a gas tank from a blank NBT tag. Sorry it took so long, trying to deal with chunk-thrashing burned me out a bit.
I just tried build 110 and got this same crash when I opened the gui for a gas generator placed directly next to an electrolytic separator:
Time: 9/25/14 12:14 PM
Description: Rendering screen
java.lang.ArithmeticException: / by zero
at mekanism.client.gui.GuiGasGauge.getScaledLevel(GuiGasGauge.java:36)
at mekanism.client.gui.GuiGauge.renderScale(GuiGauge.java:58)
at mekanism.client.gui.GuiGauge.renderBackground(GuiGauge.java:50)
at mekanism.client.gui.GuiMekanism.func_146976_a(GuiMekanism.java:117)
at mekanism.generators.client.gui.GuiGasGenerator.func_146976_a(GuiGasGenerator.java:79)
at net.minecraft.client.gui.inventory.GuiContainer.func_73863_a(GuiContainer.java:78)
at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1352)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:990)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:286)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:376)
at org.multimc.EntryPoint.listen(EntryPoint.java:165)
at org.multimc.EntryPoint.main(EntryPoint.java:54)
Full crash log:
Oh, yes. Corruption will still persist but newly crafted ones should be fine. I'll see if I can work around cleansing the corruption.