Refined Storage

Refined Storage

77M Downloads

Attempting to sort a pattern storage in a gold crafter with upgrades in it duplicates the upgrades

weswigham opened this issue ยท 2 comments

commented

Describe the bug

Attempting to sort a pattern (using middle-click sort provided by this mod) storage in a gold crafter with upgrades in it duplicates the upgrades, and deletes a pattern (in the first slot), sometimes.

In action:

sort_jank

Ref cpw/inventorysorter#109 on the inventory sorter mod; since there's no action there, I'm hoping maybe something could be fixed here? Minimally this should increase visibility of the issue.

How can we reproduce this bug or crash?

Have upgrades in a crafter. Sort it.

What Minecraft version is this happening on?

Minecraft 1.16.5

What Forge version is this happening on?

36.2.22

What Refined Storage version is this happening on?

1.9.16

Relevant log output

[06:20:35] [Server thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Server
java.lang.ClassCastException: com.refinedmods.refinedstorage.item.UpgradeItem cannot be cast to com.refinedmods.refinedstorage.api.autocrafting.ICraftingPatternProvider
        at edivad.extrastorage.nodes.AdvancedCrafterNetworkNode.invalidateSlot(AdvancedCrafterNetworkNode.java:150) ~[extrastorage:1.6.0] {re:classloading}
        at edivad.extrastorage.nodes.AdvancedCrafterNetworkNode.lambda$new$0(AdvancedCrafterNetworkNode.java:120) ~[extrastorage:1.6.0] {re:classloading}
        at com.refinedmods.refinedstorage.inventory.item.BaseItemHandler.lambda$onChanged$0(BaseItemHandler.java:61) ~[refinedstorage:1.9.16] {re:classloading}
        at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_312] {}
        at com.refinedmods.refinedstorage.inventory.item.BaseItemHandler.onChanged(BaseItemHandler.java:61) ~[refinedstorage:1.9.16] {re:classloading}
        at com.refinedmods.refinedstorage.inventory.item.BaseItemHandler.onContentsChanged(BaseItemHandler.java:56) ~[refinedstorage:1.9.16] {re:classloading}
        at net.minecraftforge.items.ItemStackHandler.setStackInSlot(ItemStackHandler.java:60) ~[forge:?] {re:classloading}
        at net.minecraftforge.items.SlotItemHandler.func_75215_d(SlotItemHandler.java:61) ~[forge:?] {re:classloading}
        at cpw.mods.inventorysorter.SortingHandler.compactInventory(SortingHandler.java:160) ~[inventorysorter:18.1.0] {re:classloading}
        at cpw.mods.inventorysorter.SortingHandler.accept(SortingHandler.java:54) ~[inventorysorter:18.1.0] {re:classloading}
        at cpw.mods.inventorysorter.SortingHandler.accept(SortingHandler.java:37) ~[inventorysorter:18.1.0] {re:classloading}
        at cpw.mods.inventorysorter.Action.execute(Action.java:68) ~[inventorysorter:18.1.0] {re:classloading}
        at cpw.mods.inventorysorter.ServerHandler.lambda$onMessage$0(ServerHandler.java:40) ~[inventorysorter:18.1.0] {re:classloading}
        at net.minecraftforge.fml.network.NetworkEvent$Context.enqueueWork(NetworkEvent.java:215) ~[forge:?] {re:classloading}
        at cpw.mods.inventorysorter.ServerHandler.onMessage(ServerHandler.java:37) ~[inventorysorter:18.1.0] {re:classloading}
        at net.minecraftforge.fml.network.simple.SimpleChannel$MessageBuilder.lambda$consumer$1(SimpleChannel.java:240) ~[forge:?] {re:classloading}
        at net.minecraftforge.fml.network.simple.IndexedMessageCodec.lambda$tryDecode$3(IndexedMessageCodec.java:128) ~[forge:?] {re:classloading}
        at java.util.Optional.ifPresent(Optional.java:159) ~[?:1.8.0_312] {}
        at net.minecraftforge.fml.network.simple.IndexedMessageCodec.tryDecode(IndexedMessageCodec.java:128) ~[forge:?] {re:classloading}
        at net.minecraftforge.fml.network.simple.IndexedMessageCodec.consume(IndexedMessageCodec.java:162) ~[forge:?] {re:classloading}
        at net.minecraftforge.fml.network.simple.SimpleChannel.networkEventListener(SimpleChannel.java:80) ~[forge:?] {re:classloading}
        at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247) ~[eventbus-4.0.0.jar:?] {}
        at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239) ~[eventbus-4.0.0.jar:?] {}
        at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}
        at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}
        at net.minecraftforge.fml.network.NetworkInstance.dispatch(NetworkInstance.java:86) ~[forge:?] {re:classloading}
        at net.minecraftforge.fml.network.NetworkHooks.lambda$onCustomPayload$1(NetworkHooks.java:91) ~[forge:?] {re:classloading}
        at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_312] {}
        at net.minecraftforge.fml.network.NetworkHooks.onCustomPayload(NetworkHooks.java:91) ~[forge:?] {re:classloading}
        at net.minecraft.network.play.ServerPlayNetHandler.func_147349_a(ServerPlayNetHandler.java:1413) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:fml:astralsorcery:reach_set_server_entity_interact,xf:fml:astralsorcery:allow_entity_interaction,re:classloading,pl:accesstransformer:B,xf:fml:astralsorcery:reach_set_server_entity_interact,xf:fml:astralsorcery:allow_entity_interaction,pl:mixin:A}
        at net.minecraft.network.play.client.CCustomPayloadPacket.func_148833_a(CCustomPayloadPacket.java:42) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
        at net.minecraft.network.play.client.CCustomPayloadPacket.func_148833_a(CCustomPayloadPacket.java:12) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
        at net.minecraft.network.PacketThreadUtil.func_225383_a(SourceFile:21) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
        at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) ~[?:?] {re:mixin,re:computing_frames,re:classloading}
        at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:734) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ftbjanitor.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
        at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:159) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ftbjanitor.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
        at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.MinecraftServer.func_213205_aW(MinecraftServer.java:717) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ftbjanitor.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
        at net.minecraft.server.MinecraftServer.func_213168_p(MinecraftServer.java:711) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ftbjanitor.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
        at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213161_c(SourceFile:127) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.MinecraftServer.func_213202_o(MinecraftServer.java:697) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ftbjanitor.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
        at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:646) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ftbjanitor.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
        at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:ftbjanitor.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312] {}
commented

I tested and this bug is also present with the RS base crafter

commented

This bug has been fixed in v1.12.4 for Minecraft 1.20.1 and v1.11.7 for Minecraft 1.19.2.
Thank you for reporting.