Skip to content

Commit

Permalink
fix peripheral will detach and reattach when ME grid changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Jan 21, 2025
1 parent a97a7b9 commit 04c6f27
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public WiredCableP2PTunnelPart(IPartItem<?> partItem) {
super(partItem, Capabilities.CAPABILITY_WIRED_ELEMENT);
this.inputHandler = outElement;
this.outputHandler = outElement;
this.emptyHandler = outElement;
this.emptyHandler = null; // should never used
}

@PartModels
Expand Down Expand Up @@ -97,13 +97,18 @@ protected void connectionsChanged() {
part.connected.add(this);
}
}
this.sendBlockUpdate();
}

@Override
protected void onMainNodeStateChanged(IGridNodeListener.State reason) {
super.onMainNodeStateChanged(reason);
if (reason == IGridNodeListener.State.GRID_BOOT) {
return;
}
if (this.isActive()) {
if (!this.getMainNode().hasGridBooted()) {
return;
}
this.connectionsChanged();
this.refreshConnection();
} else if (this.activated) {
Expand Down

0 comments on commit 04c6f27

Please sign in to comment.