
IllegalStateException whenever a connected network cable is pasted
sadan4 opened this issue · 1 comments
Minecraft Version
1.21.x
Version
Details
I'm sorry I am not that familiar with the mod, I encountered this bug and got interested.
Whenever a connected network cable is pasted with a building gadget, an illegal state exception is thrown.
Video
2025-04-29_21-08-51.mp4
Thanks for the report!
The problem here appears to be that building gadgets creates new temporary block entities for a fake world, but associates them with the real world1. When updateShape
is called, we schedule an update for next tick, which then crashes as the BE isn't where it thinks it should be!
This feels like a bug in BuildingGadgets, and I think probably worth reporting there. Though that said, I'm not sure what the right fix is — maybe you can get away with returning null
from getBlockEntity
, or maybe one has to implement roll your own Level
which pretends to be a client-side level.
On CC:T's side, we should avoid going through our custom tick scheduling code here, which would fix the issue. Though because of the mismatched levels, I am a little wary that there won't be other bugs lurking here.
Footnotes
-
So you end up in a really weird state where
level.getBlockEntity(pos).getLevel() != level
. And similarly,getLevel().getBlockEntity(getBlockPos()) != this
for the block entity. ↩