Hardcore Questing Mode [FORGE/FABRIC]

Hardcore Questing Mode [FORGE/FABRIC]

16M Downloads

HQM crashes world when book is closed or quest is chosen

PigguJones opened this issue ยท 10 comments

commented

I have been working on my HQM book for about 21 hours and out of the blue every time I close the book i get "A fatal error has occurred, this connection is terminated". It doesn't crash the client it just crashes the world. It worked before I added a chapter dealing with ProjectE so I tried removing the ProjectE chapter but it still crashes the world. If I try clicking on the first quest in chapter 1 the world crashes. I have over 98 quests typed out and configured. I really don't want to lose it.

12:34:50 FML There was a critical exception handling a packet on channel hcQuesting io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: The string is too long for this encoding. at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:106) at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1032) at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:296) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendTo(SimpleNetworkWrapper.java:250) at hardcorequesting.network.NetworkManager.sendToPlayer(NetworkManager.java:47) at hardcorequesting.quests.QuestLine.sendServerSync(QuestLine.java:86) at hardcorequesting.event.PlayerTracker.onPlayerLogin(PlayerTracker.java:39) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1988_PlayerTracker_onPlayerLogin_PlayerLoggedInEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) at net.minecraftforge.fml.common.FMLCommonHandler.firePlayerLoggedIn(FMLCommonHandler.java:575) at net.minecraft.server.management.PlayerList.initializeConnectionToPlayer(PlayerList.java:219) at shadows.fastbench.net.HijackedPlayerList.initializeConnectionToPlayer(HijackedPlayerList.java:19) at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:255) at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.access$100(NetworkDispatcher.java:72) at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.func_73660_a(NetworkDispatcher.java:205) at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:285) at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:180) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:790) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:252) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: The string is too long for this encoding. at org.apache.commons.lang3.Validate.isTrue(Validate.java:158) at net.minecraftforge.fml.common.network.ByteBufUtils.writeUTF8String(ByteBufUtils.java:166) at hardcorequesting.network.message.PlayerDataSyncMessage.toBytes(PlayerDataSyncMessage.java:53) at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.encodeInto(SimpleIndexedCodec.java:30) at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.encodeInto(SimpleIndexedCodec.java:26) at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.encode(FMLIndexedMessageToMessageCodec.java:81) at io.netty.handler.codec.MessageToMessageCodec$1.encode(MessageToMessageCodec.java:67) at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:88) ... 28 more
12:34:50 FML Network Disconnect: A fatal error has occurred, this connection is terminated
12:34:50 net.minecraft.network.NetHandlerPlayServer PigguJones lost connection: A fatal error has occurred, this connection is terminated
commented

your HQM version is probably out of date.

commented

It is version HQM-1.12.2-5.3.2 I just installed the mod on Wednesday and it was working perfectly till yesterday at about 2AM when i closed MC to do something and opened it again. From that point on it crashes the world whenever i try to close the book or select a quest. I have tried removing the quests i added closest to the crashing point but it didn't help in the slightest.

commented

if you would like i could upload the modpack and you could test for yourself

commented

Your quest data is too long. These are the changes I've made to my local copy of HQM to get it working as well as a few other things. I'll try to set up a pull request at some point.

The issue seems to stem from the fact that the UTF-8 encoding function validates that the length of the resulting string is less than 3 bytes(?? my Java is a bit fuzzy). Splitting it into 3K character chunks instead of doing it all-at-once seems to have resolved my issues locally.

commented

@duely If these changes are working and fixing this bug, then pls do a proper pull request, so that everyone can use the improvements

commented

@duely How do i make those changes to my version. I really want to be able to work on my pack

commented

@canitzp Apologies for the delay, I was away. I've issued the pull request.

@PigguJones I've issued a pull request so, if the changes are suitable and there's a new release, hopefully you can get it working. Otherwise, you can clone the branch of my fork and compile it yourself.

commented

I really really thank you @duely that you took time and fiddle out this fix. If you have time and the mood the help the team of HQM for further developement, than we take your help with great joy :)

commented

@canitzp No problems -- it was somewhat selfish of me because I'm working on a modpack with a large quest book and had to sort out the issue as soon as I came across it. I'm happy to help with whatever else I can. Most of the tweaks I've been making are just for convenience sake and probably aren't programmed properly.

commented

@duely Since you're a modpack creator and you have something to improve, than it is probably a improvement for other modpack creator too. Here is a invitation link to our discord, because it is the easiest way to communicate between authors. https://discord.gg/7QRxJMn