Refined Storage

Refined Storage

115M Downloads

Game crashes when rotating Relay and breaking Cables

HrPlanlos opened this issue ยท 6 comments

commented

Describe the bug

When I place a Relay between two System and rotate it, the Grid doesn't update the possible Crafting Recepies correctly and when breaking the Cable after rotating the Relay a second time the Game crashes.


  • After Step 1 System 1 and System 2 dont change the Autocrafting possibilities
  • After Step 2 and 3 System 1 and System 2 show only one and the same Autocrafting possibility (From System 1)
  • After Step 5 the Game will crash

How can we reproduce this bug or crash?

Setup:

  • System 1 (Left)
    • 1 x Controller
    • 1 x Grid
    • 1 x Autocrafter
      • 1 x Crafting Pattern => 4x Spruce Stairs (Fuzzy mode on)
  • System 2 (Right)
    • 1 x Controller
    • 1 x Grid
    • 1 x Autocrafter
      • 1 x Crafting Pattern => 4x Oak Stairs (Fuzzy mode on)
  • Relay between System 1 and System 2
    • Output System 1
    • Input System 2
    • Pass-through = No
    • Pass autocrafting = Yes

Image

Steps:

  1. Rotate Relay
    • Output System 2
    • Input System 1
  2. Break Cable between System 1 and Relay and place it again
  3. Break Cable between System 2 and Relay and place it again
  4. Rotate Relay
    • Output System 1
    • Input System 2
  5. Break Cable between System 1 and Relay and place it again
  6. Break Cable between System 2 and Relay and place it again

What Minecraft version is this happening on?

Minecraft 1.21.1

What NeoForge or Fabric version is this happening on?

Fabric Loader: 0.16.10

What Refined Storage version is this happening on?

refinedstorage-fabric-2.0.0-milestone.4.13.jar / main (1a5e858)

Relevant log output

java.lang.IllegalStateException: Network of resulting removed node (com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode@551bad23) cannot be empty
	at knot//com.refinedmods.refinedstorage.api.network.impl.NetworkBuilderImpl.lambda$splitNetworks$2(NetworkBuilderImpl.java:167)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at knot//com.refinedmods.refinedstorage.api.network.impl.NetworkBuilderImpl.splitNetworks(NetworkBuilderImpl.java:164)
	at knot//com.refinedmods.refinedstorage.api.network.impl.NetworkBuilderImpl.update(NetworkBuilderImpl.java:140)
	at knot//com.refinedmods.refinedstorage.common.RefinedStorageApiImpl.updateNetworkNodeContainer(RefinedStorageApiImpl.java:361)
	at knot//com.refinedmods.refinedstorage.common.api.RefinedStorageApiProxy.updateNetworkNodeContainer(RefinedStorageApiProxy.java:221)
	at knot//com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider.lambda$update$0(NetworkNodeContainerProvider.java:21)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1116)
	at knot//com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider.update(NetworkNodeContainerProvider.java:21)
	at knot//com.refinedmods.refinedstorage.common.networking.RelayBlockEntity.activenessChanged(RelayBlockEntity.java:211)
	at knot//com.refinedmods.refinedstorage.common.support.network.AbstractBaseNetworkNodeContainerBlockEntity.updateActiveness(AbstractBaseNetworkNodeContainerBlockEntity.java:93)
	at knot//com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker.tick(NetworkNodeBlockEntityTicker.java:35)
	at knot//com.refinedmods.refinedstorage.common.support.network.NetworkNodeBlockEntityTicker.tick(NetworkNodeBlockEntityTicker.java:15)
	at knot//net.minecraft.class_2818$class_5563.method_31703(class_2818.java:683)
	at knot//net.minecraft.class_2818$class_5564.method_31703(class_2818.java:737)
	at knot//net.minecraft.class_1937.method_18471(class_1937.java:488)
	at knot//net.minecraft.class_3218.method_18765(class_3218.java:413)
	at knot//net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:1021)
	at knot//net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:912)
	at knot//net.minecraft.class_1132.method_3748(class_1132.java:114)
	at knot//net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697)
	at knot//net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:281)
	at java.base/java.lang.Thread.run(Thread.java:1583)
commented

@HrPlanlos Thank you for this really good bug report (seriously good reproduction steps effort). I found a fix and I'm no longer able to reproduce. Would you be willing to stress test yourself again?

commented

Thanks for the nice feedback. Yes, I can stress-test the fix. I assume it's on the network-debug branch? If so should I report other issues I notice on that branch or is it still work in progress?

commented

@HrPlanlos Let's take it the other way, I'm going to release beta 7 in a couple of minutes. Just try with that one :D

commented

This is quite a tricky one. For now, I've decided to disable relay rotations and look at it after release.

commented

We got the same issue on my server tonight. The culprit is a network transmitter.
Crash log: https://mclo.gs/NWweRgC

RS2 MS4.14