Adding a certain amount of mods to the game breaks client-server connectivity. There is no hard limit on how many mods I can add before this happens, and it's not related to any particular mod, as I far as I can tell. The connectivity fails on the attempt to login to the server. There's no relevant message on the server rather than "playername left the game". The client message is this:
The "size" is always different, depending on what mods were added to make this start happening, but it's always the case that the size is bigger than this "protocol maximum of 2mb".
It all started when as I was exploring the game and the mods, I was gradually adding more mods to the server (with the same world), and at some moment some mods were starting to cause this. In that case I was thinking that a mod might have been broken or incompatible with something, so I simply removed it, restored the world from the backup that I had made before the procedure, and continued adding the other mods. One thing that was bothering me a bit then was that I've noticed that the troublemakers were usually bigger mods like "MiningColonies" and other mods with much content. It was also strange that there were no complaints about issues similar to mine nowhere in mods comments or issues.
After some time I'm getting to a point where adding just any mod, even the tiniest one is causing this problem. Of course, the "size" is always differen, depending on the mods that cause this. I'm at about 170 mods now and this problem is preventing me from playing the modpack that I've assembled. I've done the following tests when this started happening:
existing world with 160 mods + 10 new mods => badly compressed packet
these 10 new mods alone in a new world => ok
various combinations of 50% of these 160 mods + these 10 new mods + new world => ok
these 160 mods + these 10 mods + new world => badly compressed packet
The "160" and "10" figures are approximate but very close to what I was doing, since I did a lot of tests with various mods and combinations. Each time everything seems to always point to one thing: it looks like mods add "content" to the game that at some point overflows 2mb of a packet and that's the end. No specific mods or mod combinations were found to be the cause of this trouble. I've checked a lot of combinations by loading different amounts of various mods, testing both on a new world and on the existing one.
I am not sure how this even possible, because packets in a protocol usually exist for the very reason of being able to transfer some big amount of data by dividing it in smaller more manageable chunks, so does it indicate there is some bug in packet encoder/decoder?
I am not sure why am I getting into this problem since there are mod packs with a much higher count of mods than what I have.
Since Forge is the facility that alows using mods in the first place, I've tried looking for any mentions of a limit for the number (or "weight"?) of mods that can be loaded, but have not found any. In relevant reddit posts (How many mods in a modpack is too many?, What do you consider to be too many mods?) people never point out the "badly compressed packet" to be the issue. And again, ~170 mods is not too many since some existing modpacks include even more.
So what is happening? Am I hitting some unspoken limit of content weight? If so, then:
why is this never mentioned anywhere?
why Forge, being the one who allows for adding mods to the game in the first place, does not alleviate this problem by altering the "the protocol" if it's already changing much in Minecraft beside that?
if the latter is not possible then why there is no clear message or error on either the server or the client side that the number of mods that the game can support had been reached?
I'm not cursing Forge here, rahter I'm trying to understand what is actually happening and why there is so little information on this problem at all
I am fairly new to Minecraft and appologize if I'm missing something obvious or some common knowledge
I am attaching the logs of both the server and the client here. There are some errors like "...Could not serialize..." in the server log, but these don't look like the source of the problem because they were there even before that. Also, I've searched for info about these messages and most people say that they can be safely ignored.
logs.zip