Show structure re-scan status in /sg list

Chevron lighting and iris updates both silently no-op when
RuntimeGate.getStructure() is null (a failed re-scan), which is easy
to mistake for a chevron-specific bug when a gate that used to work
stops updating after a restart or /sg reload - the block appearance
just freezes at whatever it last was instead of erroring visibly.
/sg list now flags local gates with a null structure as
"[structure error - relink it]" in red, instead of only surfacing
this via a console warning nobody's watching.
This commit is contained in:
Michael Burgess
2026-08-09 12:35:39 -04:00
parent 576c078abf
commit ca0747196e
@@ -57,8 +57,11 @@ public class StargateCommand implements CommandExecutor, TabCompleter {
List<RuntimeGate> gates = gateManager.getNetwork(network); List<RuntimeGate> gates = gateManager.getNetwork(network);
sender.sendMessage(Component.text("Network '" + network + "' (" + gates.size() + " gate(s)):", NamedTextColor.AQUA)); sender.sendMessage(Component.text("Network '" + network + "' (" + gates.size() + " gate(s)):", NamedTextColor.AQUA));
for (RuntimeGate rg : gates) { for (RuntimeGate rg : gates) {
boolean local = rg.getGate().getServerId().equals(plugin.getServerId());
String status = !local ? "" : rg.getStructure() != null ? " [ok]" : " [structure error - relink it]";
NamedTextColor color = !local || rg.getStructure() != null ? NamedTextColor.GRAY : NamedTextColor.RED;
sender.sendMessage(Component.text(" - " + rg.getGate().getName() + " @ " + rg.getGate().getServerId() sender.sendMessage(Component.text(" - " + rg.getGate().getName() + " @ " + rg.getGate().getServerId()
+ "/" + rg.getGate().getWorld(), NamedTextColor.GRAY)); + "/" + rg.getGate().getWorld() + status, color));
} }
} }
case "destroy" -> { case "destroy" -> {