Crash when opening gui on unformed factory
jkroepke opened this issue · 8 comments
Hi,
I have a Tier 3 Factory with Gurdians. Do a right click on the Controller gives a DC. Using woot-1.12.2-0.0.5.jar
[00:41:14] [Netty Epoll Server IO #13/ERROR] [FML]: There was a critical exception handling a packet on channel woot
io.netty.handler.codec.EncoderException: java.lang.NullPointerException
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:106) ~[minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1032) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:296) ~[minecraft_server.1.12.2.jar:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendTo(SimpleNetworkWrapper.java:249) ~[SimpleNetworkWrapper.class:?]
at ipsis.woot.network.packets.PacketGetFarmInfo$Handler.handle(PacketGetFarmInfo.java:57) ~[PacketGetFarmInfo$Handler.class:?]
at ipsis.woot.network.packets.PacketGetFarmInfo$Handler.lambda$onMessage$0(PacketGetFarmInfo.java:45) ~[PacketGetFarmInfo$Handler.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_151]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_151]
at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
at org.spongepowered.common.SpongeImplHooks.onUtilRunTask(SpongeImplHooks.java:274) ~[SpongeImplHooks.class:1.12.2-2555-7.1.0-BETA-2825]
at net.minecraft.server.MinecraftServer.redirect$onRun$zjg000(MinecraftServer.java:4007) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:721) ~[MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:396) ~[nz.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:666) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:524) ~[MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: java.lang.NullPointerException
at ipsis.woot.network.packets.PacketFarmInfo.toBytes(PacketFarmInfo.java:64) ~[PacketFarmInfo.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.encodeInto(SimpleIndexedCodec.java:30) ~[SimpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.encodeInto(SimpleIndexedCodec.java:26) ~[SimpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.encode(FMLIndexedMessageToMessageCodec.java:71) ~[FMLIndexedMessageToMessageCodec.class:?]
at io.netty.handler.codec.MessageToMessageCodec$1.encode(MessageToMessageCodec.java:67) ~[minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:88) ~[minecraft_server.1.12.2.jar:?]
... 21 more
[00:41:14] [Netty Epoll Server IO #13/ERROR] [FML]: Network Disconnect: A fatal error has occurred, this connection is terminated
For now it should only happen if you right click an unformed factory heart.
Fully formed factories should not exhibit the issue - I think.
I think I know what the problem is and I try to get a fix out tonight.
I just need to replicate it to make sure I'm fixing the bug that you are seeing rather than a different one I can see in the mid.
The gui shouldn't open when the factory is unformed as the data is unavailable, however I'm not stopping that from happening.
If it helps, I can build a MultiMC pack with the savegame, if you are not able to reproduce it. But it will take some time to build it.
If I'm correct then I should be able to reproduce it by putting down the heart block and then clicking on it. But I'll get back to you if that doesn't produce the same stack trace.
I'm guessing that this happened when you opened the gui on the farm.
So a couple of questions, just to help me out.
Are you running Sponge?
Did it happen the first time you opened the GUI?
Was the factory formed when you tried to open the GUI?
The trace suggests that the tier value was null, so I'm wondering if I'm not handling unformed factories correctly.
Hi!
firstly the T2 Blaze factory works fine on your server so it isn‘t a general problem with your mod.
I'm guessing that this happened when you opened the gui on the farm.
Correct. This behavior are for all player the same.
Are you running Sponge?
Yes. But only SpongeForge without any Sponge mods.
Did it happen the first time you opened the GUI?
Yes.
Was the factory formed when you tried to open the GUI?
Unrelated, but on the frist try the factory was not fromed.
The trace suggests that the tier value was null, so I'm wondering if I'm not handling unformed factories correctly.
The Controller as item explains me on the tooltip he want TIER_THREE. (Item tooltip)
Putting down a heart and right clicking caused the same exception.
io.netty.handler.codec.EncoderException: java.lang.NullPointerException at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:106) ~[MessageToMessageEncoder.class:4.1.9.Final] at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[MessageToMessageCodec.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1032) ~[DefaultChannelPipeline.class:4.1.9.Final] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:296) ~[AbstractChannel.class:4.1.9.Final] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendTo(SimpleNetworkWrapper.java:249) ~[SimpleNetworkWrapper.class:?] at ipsis.woot.network.packets.PacketGetFarmInfo$Handler.handle(PacketGetFarmInfo.java:57) ~[PacketGetFarmInfo$Handler.class:?] at ipsis.woot.network.packets.PacketGetFarmInfo$Handler.lambda$onMessage$0(PacketGetFarmInfo.java:45) ~[PacketGetFarmInfo$Handler.class:?] at java.util.concurrent.Executors$RunnableAdapter.call$$$capture(Executors.java:511) [?:1.8.0_102] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java) [?:1.8.0_102] at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [?:1.8.0_102] at java.util.concurrent.FutureTask.run(FutureTask.java) [?:1.8.0_102] at net.minecraft.util.Util.runTask(Util.java:53) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:796) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:741) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:590) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_102] Caused by: java.lang.NullPointerException at ipsis.woot.network.packets.PacketFarmInfo.toBytes(PacketFarmInfo.java:64) ~[PacketFarmInfo.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.encodeInto(SimpleIndexedCodec.java:30) ~[SimpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.encodeInto(SimpleIndexedCodec.java:26) ~[SimpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.encode(FMLIndexedMessageToMessageCodec.java:71) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$1.encode(MessageToMessageCodec.java:67) ~[MessageToMessageCodec$1.class:4.1.9.Final] at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:88) ~[MessageToMessageEncoder.class:4.1.9.Final] ... 21 more