Sleeping bag packet error.
ShadwDrgn opened this issue ยท 7 comments
https://github.com/TheIllusiveC4/Comforts/blob/master/src/main/java/c4/comforts/common/util/SleepHelper.java#L171 seems to be causing a stacktrace for me every time i try to use a sleeping bag. The character using the bag doesn't lay down and no gui comes up or overlay. if no one else sleeps they're stuck that way until daytime.
[19:55:21] [Server thread/ERROR] [FML]: FMLIndexedMessageCodec exception caught io.netty.handler.codec.EncoderException: java.lang.RuntimeException: Undefined discriminator for message type SPacketSleep in channel comforts at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:106) ~[MessageToMessageEncoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[MessageToMessageCodec.class:?] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1032) ~[DefaultChannelPipeline.class:?] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:296) ~[AbstractChannel.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendTo(SimpleNetworkWrapper.java:250) [SimpleNetworkWrapper.class:?] at c4.comforts.common.util.SleepHelper.goToSleep(SleepHelper.java:171) [SleepHelper.class:?] at c4.comforts.common.items.ItemSleepingBag.func_77659_a(ItemSleepingBag.java:65) [ItemSleepingBag.class:?] at net.minecraft.item.ItemStack.func_77957_a(ItemStack.java:217) [aip.class:?] at net.minecraft.server.management.PlayerInteractionManager.func_187250_a(PlayerInteractionManager.java:358) [or.class:?] at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:763) [pa.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItem.func_148833_a(SourceFile:32) [mb.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItem.func_148833_a(SourceFile:9) [mb.class:?] at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [hv$1.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 net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:723) [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:668) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151] Caused by: java.lang.RuntimeException: Undefined discriminator for message type SPacketSleep in channel comforts at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.encode(FMLIndexedMessageToMessageCodec.java:72) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$1.encode(MessageToMessageCodec.java:67) ~[MessageToMessageCodec$1.class:?] at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:88) ~[MessageToMessageEncoder.class:?] ... 25 more
I'm on forge 2705 (currently the latest recommended)
Yeah, you'll be stuck because if something happens to the packet transmission then the server and client desync and you're trapped in a figurative limbo. This could be caused by some updated Forge code, it's been a long time since I did anything to this mod. I'll look into it.
Fastest reply to a bug submission ever. thanks for the close attention. seems to only happen on server. Server and client using same forge and comforts version of course.
comforts-1.12.2-1.1.1.1.jar
Sorry I commented something completely stupid and related to 1.7.2 lol deleted it. Thanks for looking at this. It's almost certainly due to updated forge. I had another server on forget 25xx and this is 2705. Server on 25xx didn't have this problem.
May be related or same issue: TeamJM/journeymap#42
and this pull: MinecraftForge/MinecraftForge#4890
Alright, just had to make sure to register the message on both the client and the server so that the discriminator is known to both sides. Why didn't I do that to begin with? No idea.
Anyway, I'm uploading a new update to CurseForge right now so hopefully it'll be up soon for you.