Skip to content

Commit

Permalink
- Try to fix AE2-UEL#47.
Browse files Browse the repository at this point in the history
  • Loading branch information
KasumiNova committed Mar 6, 2024
1 parent bed1517 commit 7c94a7a
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import appeng.api.AEApi;
import appeng.api.exceptions.FailedConnectionException;
import appeng.api.exceptions.SecurityConnectionException;
import appeng.api.networking.GridFlags;
import appeng.api.networking.IGridConnection;
import appeng.api.networking.IGridNode;
Expand All @@ -18,9 +19,12 @@
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
import appeng.core.AELog;
import appeng.hooks.TickHandler;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
import appeng.me.GridNode;
import appeng.parts.PartModel;
import appeng.util.IWorldCallable;
import appeng.util.Platform;
import co.neeve.nae2.Tags;
import co.neeve.nae2.client.rendering.helpers.BeamFormerRenderHelper;
Expand Down Expand Up @@ -390,7 +394,13 @@ public TickRateModulation tickingRequest(@NotNull IGridNode node, int ticksSince
try {
this.connect(potentialFormer, blockSet);
return TickRateModulation.SLEEP;

} catch (final SecurityConnectionException e) {
// See https://github.com/AE2-UEL/NAE2/issues/47.
TickHandler.INSTANCE.addCallable(node.getWorld(), _world -> {
node.getMachine().securityBreak();
return null;
});
return TickRateModulation.SLEEP;
} catch (final FailedConnectionException | NullPointerException e) {
// We tried. We found the beam former, but couldn't establish the connection.
// If the former isn't ready yet, wait until it's ready, and it will try connecting
Expand Down

0 comments on commit 7c94a7a

Please sign in to comment.