{{ message }}
Repository navigation
Tags: MrTJP/ProjectRed
Tags
fix: prevent red alloy/insulated wire from becoming unpowerable after…
… a thrown lookup
RedstonePropagator's global redstone flags were toggled around connection
discovery and signal calculation without try/finally, so a neighbor lookup that
threw mid-way left the static flag stuck in its temporary value for the rest of
the session.
Most visibly, FramedRedwirePart and RedstoneTubePart#discoverStraightOverride
set canConnectRedwires=false and restore it afterwards. If
RedstoneInteractions.{otherConnectionMask,connectionMask} throws (e.g. a modded
neighbor or a partially-loaded chunk), the restore is skipped and the flag is
left false. RedwirePart#canConnectRedstone then returns false for every face red
alloy/insulated wire, so they report no redstone connection and read zero vanilla
power -- they can no longer be powered. Gates and vanilla redstone are unaffected
(different flags / code paths), which is why only the wires appear broken.
The flags are only reset on ServerAboutToStartEvent, so the corruption persists
for an entire dedicated-server session while singleplayer silently recovers on
each world reload.
Wrap every RedstonePropagator flag toggle (canConnectRedwires in
discoverStraightOverride, and the dust/redwire power flags in calculateSignal) in
try/finally so global state is always restored even if a lookup throws.
Affects RedwirePart, FramedRedwirePart, RedstoneTubePart, and ArrayGatePart.
PreviousNext
