sisby-folk / tinkerers-smithing

A minecraft mod implementing a sentimental and convenient rebalance of minecraft gear crafting, repair, combining, and smithing.
https://modrinth.com/mod/tinkerers-smithing
GNU Lesser General Public License v3.0
4 stars 5 forks source link

[Bug-1.20.1Fabric]Unable to connect to multiplayer server #33

Closed OcrSu closed 9 months ago

OcrSu commented 9 months ago

MC:1.20.1 Fabric Java21

image

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
    at folk.sisby.tinkerers_smithing.TinkerersSmithingLoader.ingredientId(TinkerersSmithingLoader.java:331) ~[tinkerers-smithing-2.6.0+1.20.jar:?]
    at folk.sisby.tinkerers_smithing.recipe.ShapelessRepairRecipe.<init>(ShapelessRepairRecipe.java:35) ~[tinkerers-smithing-2.6.0+1.20.jar:?]
    at folk.sisby.tinkerers_smithing.recipe.ShapelessRepairRecipe$Serializer.read(ShapelessRepairRecipe.java:105) ~[tinkerers-smithing-2.6.0+1.20.jar:?]
    at folk.sisby.tinkerers_smithing.recipe.ShapelessRepairRecipe$Serializer.method_8122(ShapelessRepairRecipe.java:93) ~[tinkerers-smithing-2.6.0+1.20.jar:?]
    at net.minecraft.class_2788.method_17817(class_2788.java:45) ~[client-intermediary.jar:?]
    at net.minecraft.class_2540.method_34068(class_2540.java:218) ~[client-intermediary.jar:?]
    at net.minecraft.class_2540.method_34066(class_2540.java:231) ~[client-intermediary.jar:?]
    at net.minecraft.class_2788.<init>(class_2788.java:22) ~[client-intermediary.jar:?]
    at net.minecraft.class_2539$class_4532.method_22310(class_2539.java:459) ~[client-intermediary.jar:?]
    at net.minecraft.class_2539.method_10783(class_2539.java:522) ~[client-intermediary.jar:?]
    at net.minecraft.class_2543.decode(class_2543.java:32) ~[client-intermediary.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:519) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:458) ~[netty-codec-4.1.82.Final.jar:?]
    ... 36 more
[16:41:07] [Netty Client IO #3/INFO]: (This is for debugging only. You can ignore that. Logging limit 1/5) Exception from connection: 
io.netty.handler.codec.DecoderException: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:489) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:280) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:336) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:308) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:336) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:444) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:280) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[netty-handler-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.82.Final.jar:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.82.Final.jar:?]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.82.Final.jar:?]
    at java.lang.Thread.run(Thread.java:1583) ~[?:?]
sisby-folk commented 9 months ago

just a missing empty check! should be fixed in 2.6.1

OcrSu commented 9 months ago
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
    at folk.sisby.tinkerers_smithing.TinkerersSmithingLoader.ingredientId(TinkerersSmithingLoader.java:331) ~[tinkerers-smithing-2.6.1+1.20.jar:?]
    at folk.sisby.tinkerers_smithing.recipe.ShapelessRepairRecipe.<init>(ShapelessRepairRecipe.java:35) ~[tinkerers-smithing-2.6.1+1.20.jar:?]
    at folk.sisby.tinkerers_smithing.recipe.ShapelessRepairRecipe$Serializer.read(ShapelessRepairRecipe.java:105) ~[tinkerers-smithing-2.6.1+1.20.jar:?]
    at folk.sisby.tinkerers_smithing.recipe.ShapelessRepairRecipe$Serializer.method_8122(ShapelessRepairRecipe.java:93) ~[tinkerers-smithing-2.6.1+1.20.jar:?]
    at net.minecraft.class_2788.method_17817(class_2788.java:45) ~[client-intermediary.jar:?]
    at net.minecraft.class_2540.method_34068(class_2540.java:218) ~[client-intermediary.jar:?]
    at net.minecraft.class_2540.method_34066(class_2540.java:231) ~[client-intermediary.jar:?]
    at net.minecraft.class_2788.<init>(class_2788.java:22) ~[client-intermediary.jar:?]
    at net.minecraft.class_2539$class_4532.method_22310(class_2539.java:459) ~[client-intermediary.jar:?]
    at net.minecraft.class_2539.method_10783(class_2539.java:522) ~[client-intermediary.jar:?]
    at net.minecraft.class_2543.decode(class_2543.java:32) ~[client-intermediary.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:519) ~[netty-codec-4.1.82.Final.jar:?]
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:458) ~[netty-codec-4.1.82.Final.jar:?]
OcrSu commented 9 months ago

just a missing empty check! should be fixed in 2.6.1

it happens ag....

OcrSu commented 9 months ago

2024-01-28-5 (1).log

client log here

sisby-folk commented 9 months ago

Seems like there are ingredients that are empty on the client but populated on the server - not sure which mod causes this to happen, so in 2.6.2 we've changed it to log an error instead of crash - could you try that and upload a full latest log to https://mclo.gs/ ?

OcrSu commented 9 months ago

Seems like there are ingredients that are empty on the client but populated on the server - not sure which mod causes this to happen, so in 2.6.2 we've changed it to log an error instead of crash - could you try that?

OK , i will try it now

OcrSu commented 9 months ago

ModVersion2.6.1: https://mclo.gs/yWTFUH6

Seems like there are ingredients that are empty on the client but populated on the server - not sure which mod causes this to happen, so in 2.6.2 we've changed it to log an error instead of crash - could you try that and upload a full latest log to https://mclo.gs/ ?

OcrSu commented 9 months ago

ModVersion:2.6.2 https://mclo.gs/2wmkmhO

I successfully entered the server, here is the client log Ingredients for Tinkerer's Smithing recipes can't be empty! When repairing item minecraft:wooden_pickaxe

ServerLog: https://mclo.gs/Sl0Tbnz

[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/wooden_pickaxe/planks!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/wooden_axe/planks!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/wooden_hoe/planks!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/stone_shovel/stone_tool_materials!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/wooden_shovel/planks!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/shield/planks!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/stone_pickaxe/stone_tool_materials!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/stone_sword/stone_tool_materials!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/wooden_sword/planks!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/stone_hoe/stone_tool_materials!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/bakery/rolling_pin/planks!
[08:32:16] [Netty Server IO #2/ERROR]: No matching stacks while serializing repair recipe tinkerers_smithing:repair/stone_axe/stone_tool_materials!
sisby-folk commented 9 months ago

Seems like it happens for items that have tag ingredients - so #planks and #stone_tool_materials - in the server log, are there errors logged on login saying that stacks are empty while serializing?

OcrSu commented 9 months ago

Seems like it happens for items that have tag ingredients - so #planks and #stone_tool_materials - in the server log, are there errors logged on login saying that stacks are empty while serializing?

Only errors like this.. No matching stacks while serializing repair recipe tinkerers_smithing:repair/wooden_pickaxe/planks!

sisby-folk commented 9 months ago

Yep okay that's the one - this error occurs when a mod tries to access the contents of a tag ingredient before it's loaded in - I'll try find out how that might be happening.

sisby-folk commented 9 months ago

I couldn't find which mod is the culprit by guessing, and this behaviour definitely breaks those recipes - so I've cooked up a special jar for you to use:

tinkerers-smithing-2.6.2+1.20.jar.zip

it should log a completely new error on the server ([Tinkerer's Smithing] A footgun was fired!) when a mod tries to access ingredient stacks at the wrong time, and the trace should help us find out who it is.

sisby-folk commented 9 months ago

released as 2.6.3 - try that version.

OcrSu commented 9 months ago

released as 2.6.3 - try that version.

I tried version 2.6.3. My server is stuck in the startup phase (after loading the terrain). image ServerLog:https://mclo.gs/vfy6zG1

sisby-folk commented 9 months ago

Yep, so that's betternether accessing material repair ingredients at init time, well before tags are loaded. I think it's only accessing its own ingredients, and none of them use tags - so that's actually okay. So i'm going to make the anti-footgun mixin make sure there's a tag entry before it intervenes. Try out 2.6.4.

OcrSu commented 9 months ago

Yep, so that's betternether accessing material repair ingredients at init time, well before tags are loaded. I think it's only accessing its own ingredients, and none of them use tags - so that's actually okay. So i'm going to make the anti-footgun mixin make sure there's a tag entry before it intervenes. Try out 2.6.4.

ClientLog:https://mclo.gs/Qq9M6aT ServerLog:https://mclo.gs/tEzAqR2 image image

sisby-folk commented 9 months ago

This is becoming a very large goose chase - here's a version with a much more strict check that refuses to let tag ingredients be touched if #minecraft:planks doesn't have any entries. tinkerers-smithing-2.6.5+1.20.jar.zip

sisby-folk commented 9 months ago

ugh, ignore that, that breaks even on vanilla

sisby-folk commented 9 months ago

tinkerers-smithing-2.6.5+1.20.jar.zip

just forgot to negate the conditon correctly as it turns out - try this one when you can.

OcrSu commented 9 months ago

tinkerers-smithing-2.6.5+1.20.jar.zip

just forgot to negate the conditon correctly as it turns out - try this one when you can.

Fixed Confirm

sisby-folk commented 9 months ago

Could you send through a server log for this one? It would tell us which mod to report the base issue to.

OcrSu commented 9 months ago

Could you send through a server log for this one? It would tell us which mod to report the base issue to.

Server Log: https://mclo.gs/2JMUWc7

sisby-folk commented 9 months ago

Looks like it's https://github.com/Truly-Modular/Armory/blob/master/common/src/main/java/smartin/armory/GenerateArmorModularConverter.java#L43 from truly modular armory causing the issue. I'll report to them, but I'll also release this safe version properly.

OcrSu commented 9 months ago

Looks like it's https://github.com/Truly-Modular/Armory/blob/master/common/src/main/java/smartin/armory/GenerateArmorModularConverter.java#L43 from truly modular armory causing the issue. I'll report to them, but I'll also release this safe version properly.

Thanks!

sisby-folk commented 9 months ago

reported here https://github.com/Truly-Modular/Modular-Item-API/issues/29 and published 2.6.5 - thanks for the help!