AllTheMods / ATM-3

Official ATM3 Repo
https://allthemods.net/
49 stars 29 forks source link

[6.1.0] Refined Storage + JEI Crafting Crash #990

Open Klebestreifen opened 2 years ago

Klebestreifen commented 2 years ago

Expected Behavior

If you click on the "+" icon in JEI so that items are automatically placed in the crafting grid, no error should occur. In singleplayer the game should not freeze and in multiplayer you should not lose the connection.

Current Behavior

If you click on the "+" icon in JEI to automatically put items in the crafting grid, you lose the connection in multiplayer. A single player game freezes. This happens with every recipe for which the necessary items are available in the storage. This error does not occur with recipes where items are missing. This happens with every recipe. For example, with a vanilla chest.

Possible Solution

I tried to install a test instance with few mods that could affect the crafting system or JEI. All mods are on the same version as in ATM3. Furthermore I have taken the config folder from ATM3. Forge is also on the same version. Currently I have not found the culprit yet. In my test instance I could not reproduce the error yet. Therefore I suspect that the error does not come from Refined Storage. It is probably due to the interaction with another mod.

My test instance mods:

    atmtweaks-1.2.jar
    Baubles-1.12-1.5.2.jar
    CraftingTweaks_1.12.2-8.1.9.jar
    CraftTweaker2-1.12-4.1.20.647.jar
    foamfix-0.10.14-1.12.2.jar
    forestry_1.12.2-5.8.2.387.jar
    HelpFixer-1.12.1-1.5.18.jar
    InventoryTweaks-1.64+dev.151.jar
    jeibees-0.9.0.5-mc1.12.2.jar
    jeiintegration_1.12.2-1.6.0.jar
    jei_1.12.2-4.16.1.301.jar
    justenoughdimensions-1.12.2-1.6.0-dev.20200416.184714.jar
    JustEnoughResources-1.12.2-0.9.2.60.jar
    modtweaker-4.0.19.jar
    MouseTweaks-2.10-mc1.12.2.jar
    MTLib-3.0.7.jar
    refinedstorage-1.6.16.jar
    refinedstorageaddons-0.4.5.jar
    Thaumcraft-1.12.2-6.1.BETA26.jar
    ThaumicJEI-1.12.2-1.6.0-27.jar

Steps to Reproduce

  1. Build a simple RS system
  2. Put 8 or more planks into it.
  3. Open the recipe view of a chest in JEI
  4. Click on the "+" icon to have the planks automatically placed in the Crafting Grid.
  5. The error occurs.

Log

The game does not crash but I have an exception from a multiplayer session. Unfortunately relatively meaningless.

NetworkDispatcher exception
java.lang.IllegalArgumentException: Payload may not be larger than 32767 bytes
    at net.minecraft.network.play.client.CPacketCustomPayload.<init>(CPacketCustomPayload.java:28)
    at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.toC17Packet(FMLProxyPacket.java:142)
    at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.write(NetworkDispatcher.java:533)
    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.minecraft.network.NetworkManager$4.run(NetworkManager.java:245)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    at java.lang.Thread.run(Thread.java:745)

Detailed Description

This error occurs in ATM3-v6.1.0. Other players were able to reproduce the error. So far, this has only been tried with the CurseForge launcher on Windows 10 x64.

For everything else, see the description above.

The bug is unfortunately quite game-breaking. I hope you will get this bug fixed in cooperation with the mod authors concerned.

Thank you very much for your effort. You invest a lot of love in the Minecraft modding community.

See Also

897

Pelotrio commented 2 years ago

That happens because the maximum size for a packet payload in minecraft is 32767 bytes. The amount of different items that are a available for the current recipe all have to be sent to the client and can exceed that limit. This mostly happens if a lot of different items are valid for one recipe. For example sapplings, wood, leaves etc. would break if too many mods add variants of these items (oredict). This could only be fixed by either splitting the packet into multiple ones and then handling them on the sever side or increasing the limit but that would require a core-mod. What also would work is to catch the exception so it won't kick you but that is not a real fix. If you would play on a multiplayer server you would instead get kicked for that with an error message that would mention the 32767 bytes.

Pelotrio commented 2 years ago

@Klebestreifen I have a temporary solution for this if you want it you can check out the official atm discord server here: https://discord.gg/allthemods. There is a section for atm 3 and other legacy packs where I am generally at.