Turtle transfer crash
Lemmmy opened this issue ยท 2 comments
Minecraft Version
1.19.x
Version
1.102.2-3a51162
Details
Crash 4f121402a4eb29d3
on SC3, log 0ddfcd1caa9c8b47
Time: 2023-02-16 15:46:36
Description: Ticking block entity
java.lang.IllegalArgumentException: Amount may not be negative, but it is: -5
at Not Enough Crashes deobfuscated stack trace.(1.19.3+build.3)
at net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions.notNegative(StoragePreconditions.java:50)
at net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions.notBlankNotNegative(StoragePreconditions.java:59)
at net.fabricmc.fabric.api.transfer.v1.item.base.SingleStackStorage.extract(SingleStackStorage.java:136)
at net.fabricmc.fabric.impl.transfer.item.InventorySlotWrapper.extract(InventorySlotWrapper.java:96)
at net.fabricmc.fabric.impl.transfer.item.InventorySlotWrapper.extract(InventorySlotWrapper.java:39)
at net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil.move(StorageUtil.java:99)
at dan200.computercraft.shared.platform.FabricContainerTransfer.moveTo(FabricContainerTransfer.java:40)
at dan200.computercraft.shared.turtle.core.TurtleSuckCommand.execute(TurtleSuckCommand.java:53)
at dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands(TurtleBrain.java:650)
at dan200.computercraft.shared.turtle.core.TurtleBrain.update(TurtleBrain.java:116)
at dan200.computercraft.shared.turtle.blocks.TurtleBlockEntity.serverTick(TurtleBlockEntity.java:140)
at dan200.computercraft.shared.computer.blocks.AbstractComputerBlock.lambda$new$0(AbstractComputerBlock.java:48)
at net.minecraft.world.chunk.WorldChunk$DirectBlockEntityTickInvoker.tick(WorldChunk:659)
at net.minecraft.world.chunk.WorldChunk$WrappedBlockEntityTickInvoker.tick(WorldChunk:713)
at net.minecraft.world.World.tickBlockEntities(World:472)
at net.minecraft.server.world.ServerWorld.tick(ServerWorld:379)
at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:886)
at net.minecraft.server.dedicated.MinecraftDedicatedServer.tickWorlds(MinecraftDedicatedServer:283)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer:830)
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer:676)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer:264)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Server thread
Stacktrace:
at net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions.notNegative(StoragePreconditions.java:50)
at net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions.notBlankNotNegative(StoragePreconditions.java:59)
at net.fabricmc.fabric.api.transfer.v1.item.base.SingleStackStorage.extract(SingleStackStorage.java:136)
at net.fabricmc.fabric.impl.transfer.item.InventorySlotWrapper.extract(InventorySlotWrapper.java:96)
at net.fabricmc.fabric.impl.transfer.item.InventorySlotWrapper.extract(InventorySlotWrapper.java:39)
at net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil.move(StorageUtil.java:99)
at dan200.computercraft.shared.platform.FabricContainerTransfer.moveTo(FabricContainerTransfer.java:40)
at dan200.computercraft.shared.turtle.core.TurtleSuckCommand.execute(TurtleSuckCommand.java:53)
at dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands(TurtleBrain.java:650)
at dan200.computercraft.shared.turtle.core.TurtleBrain.update(TurtleBrain.java:116)
at dan200.computercraft.shared.turtle.blocks.TurtleBlockEntity.serverTick(TurtleBlockEntity.java:140)
at dan200.computercraft.shared.computer.blocks.AbstractComputerBlock.lambda$new$0(AbstractComputerBlock.java:48)
at net.minecraft.class_2818$class_5563.method_31703(class_2818.java:659)
at net.minecraft.class_2818$class_5564.method_31703(class_2818.java:713)
at net.minecraft.class_1937.method_18471(class_1937.java:472)
at net.minecraft.class_3218.method_18765(class_3218.java:379)
-- Block entity being ticked --
Details:
Name: computercraft:turtle_normal // dan200.computercraft.shared.turtle.blocks.TurtleBlockEntity
Block: Block{computercraft:turtle_normal}[facing=west,waterlogged=false]
Block location: World: (9195,66,-8509), Section: (at 11,2,3 in 574,4,-532; chunk contains blocks 9184,-64,-8512 to 9199,319,-8497), Region: (17,-17; contains chunks 544,-544 to 575,-513, blocks 8704,-64,-8704 to 9215,319,-8193)
Block: Block{computercraft:turtle_normal}[facing=west,waterlogged=false]
Block location: World: (9195,66,-8509), Section: (at 11,2,3 in 574,4,-532; chunk contains blocks 9184,-64,-8512 to 9199,319,-8497), Region: (17,-17; contains chunks 544,-544 to 575,-513, blocks 8704,-64,-8704 to 9215,319,-8193)
Block Entity NBT: {ComputerId:2576,Fuel:0,Items:[{Count:16b,Slot:0b,id:"minecraft:snowball"},{Count:16b,Slot:1b,id:"minecraft:snowball"},{Count:16b,Slot:2b,id:"minecraft:snowball"},{Count:16b,Slot:3b,id:"minecraft:snowball"},{Count:16b,Slot:4b,id:"minecraft:snowball"},{Count:5b,Slot:5b,id:"minecraft:snowball"}],On:1b,Owner:{LowerId:XXX,Name:XXX,UpperId:XXX},RightUpgrade:"minecraft:crafting_table",Slot:4}
Stacktrace:
at net.minecraft.class_2818$class_5563.method_31703(class_2818.java:659)
at net.minecraft.class_2818$class_5564.method_31703(class_2818.java:713)
at net.minecraft.class_1937.method_18471(class_1937.java:472)
at net.minecraft.class_3218.method_18765(class_3218.java:379)
at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:886)
at net.minecraft.class_3176.method_3813(class_3176.java:283)
at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:830)
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:676)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:264)
at java.base/java.lang.Thread.run(Unknown Source)
I'm not quite sure what's going on here. CC is just calling Fabric's inventory storage method (we don't do anything fancy, and the quantity will be non-negative). This suggests there's a bug in either Fabric's inventory transfer code or the underlying inventory.
In this case, we're interacting with an sc-goodies ender storage chest:
I can't imagine it's doing anything odd, but probably the best place to start looking!
This same crash appears to have happened again; this time the culprit appears to be a diamond chest.
java.lang.IllegalArgumentException: Amount may not be negative, but it is: -6
at Not Enough Crashes deobfuscated stack trace.(1.19.3+build.3)
at net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions.notNegative(StoragePreconditions.java:50)
at net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions.notBlankNotNegative(StoragePreconditions.java:59)
at net.fabricmc.fabric.api.transfer.v1.item.base.SingleStackStorage.extract(SingleStackStorage.java:136)
at net.fabricmc.fabric.impl.transfer.item.InventorySlotWrapper.extract(InventorySlotWrapper.java:96)
at net.fabricmc.fabric.impl.transfer.item.InventorySlotWrapper.extract(InventorySlotWrapper.java:39)
at net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil.move(StorageUtil.java:99)
at dan200.computercraft.shared.platform.FabricContainerTransfer.moveTo(FabricContainerTransfer.java:40)
at dan200.computercraft.shared.turtle.core.TurtleSuckCommand.execute(TurtleSuckCommand.java:53)
at dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands(TurtleBrain.java:649)
at dan200.computercraft.shared.turtle.core.TurtleBrain.update(TurtleBrain.java:115)
at dan200.computercraft.shared.turtle.blocks.TurtleBlockEntity.serverTick(TurtleBlockEntity.java:100)
at dan200.computercraft.shared.computer.blocks.AbstractComputerBlock.lambda$new$0(AbstractComputerBlock.java:48)
at net.minecraft.world.chunk.WorldChunk$DirectBlockEntityTickInvoker.tick(WorldChunk:659)
at net.minecraft.world.chunk.WorldChunk$WrappedBlockEntityTickInvoker.tick(WorldChunk:713)
at net.minecraft.world.World.tickBlockEntities(World:472)
at net.minecraft.server.world.ServerWorld.tick(ServerWorld:379)
at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:886)
at net.minecraft.server.dedicated.MinecraftDedicatedServer.tickWorlds(MinecraftDedicatedServer:283)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer:830)
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer:676)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer:264)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Server thread
Stacktrace:
at net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions.notNegative(StoragePreconditions.java:50)
at net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions.notBlankNotNegative(StoragePreconditions.java:59)
at net.fabricmc.fabric.api.transfer.v1.item.base.SingleStackStorage.extract(SingleStackStorage.java:136)
at net.fabricmc.fabric.impl.transfer.item.InventorySlotWrapper.extract(InventorySlotWrapper.java:96)
at net.fabricmc.fabric.impl.transfer.item.InventorySlotWrapper.extract(InventorySlotWrapper.java:39)
at net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil.move(StorageUtil.java:99)
at dan200.computercraft.shared.platform.FabricContainerTransfer.moveTo(FabricContainerTransfer.java:40)
at dan200.computercraft.shared.turtle.core.TurtleSuckCommand.execute(TurtleSuckCommand.java:53)
at dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands(TurtleBrain.java:649)
at dan200.computercraft.shared.turtle.core.TurtleBrain.update(TurtleBrain.java:115)
at dan200.computercraft.shared.turtle.blocks.TurtleBlockEntity.serverTick(TurtleBlockEntity.java:100)
at dan200.computercraft.shared.computer.blocks.AbstractComputerBlock.lambda$new$0(AbstractComputerBlock.java:48)
at net.minecraft.class_2818$class_5563.method_31703(class_2818.java:659)
at net.minecraft.class_2818$class_5564.method_31703(class_2818.java:713)
at net.minecraft.class_1937.method_18471(class_1937.java:472)
at net.minecraft.class_3218.method_18765(class_3218.java:379)
-- Block entity being ticked --
Details:
Name: computercraft:turtle_normal // dan200.computercraft.shared.turtle.blocks.TurtleBlockEntity
Block: Block{computercraft:turtle_normal}[facing=east,waterlogged=false]
Block location: World: (22,63,288), Section: (at 6,15,0 in 1,3,18; chunk contains blocks 16,-64,288 to 31,319,303), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,-64,0 to 511,319,511)
Block: Block{computercraft:turtle_normal}[facing=east,waterlogged=false]
Block location: World: (22,63,288), Section: (at 6,15,0 in 1,3,18; chunk contains blocks 16,-64,288 to 31,319,303), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,-64,0 to 511,319,511)
Block Entity NBT: {ComputerId:2341,Fuel:1188,Items:[{Count:64b,Slot:0b,id:"minecraft:dried_kelp"},{Count:64b,Slot:1b,id:"minecraft:dried_kelp"},{Count:15b,Slot:2b,id:"minecraft:dried_kelp"},{Count:64b,Slot:3b,id:"minecraft:dried_kelp"},{Count:43b,Slot:4b,id:"minecraft:dried_kelp"},{Count:43b,Slot:5b,id:"minecraft:dried_kelp"},{Count:43b,Slot:6b,id:"minecraft:dried_kelp"},{Count:35b,Slot:8b,id:"minecraft:dried_kelp"},{Count:35b,Slot:9b,id:"minecraft:dried_kelp"},{Count:28b,Slot:10b,id:"minecraft:dried_kelp"},{Count:21b,Slot:12b,id:"minecraft:dried_kelp"},{Count:14b,Slot:13b,id:"minecraft:dried_kelp"},{Count:14b,Slot:14b,id:"minecraft:dried_kelp"}],Label:XXX,On:1b,Owner:{LowerId:XXX,Name:XXX,UpperId:XXX},RightUpgrade:"minecraft:crafting_table",Slot:1}
Stacktrace:
at net.minecraft.class_2818$class_5563.method_31703(class_2818.java:659)
at net.minecraft.class_2818$class_5564.method_31703(class_2818.java:713)
at net.minecraft.class_1937.method_18471(class_1937.java:472)
at net.minecraft.class_3218.method_18765(class_3218.java:379)
at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:886)
at net.minecraft.class_3176.method_3813(class_3176.java:283)
at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:830)
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:676)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:264)
at java.base/java.lang.Thread.run(Unknown Source)
Crash 0c82e66c9a207fc0
on SC3.
The diamond chest is a very standard implementation of LootableContainerBlockEntity (RandomizableContainerBlockEntity) and the code is almost identical to that of a vanilla chest. Of course I can't rule out that the bug lies in sc-goodies but I think it's unlikely. We'd have to see it happen on a vanilla inventory to be 100% sure.