Report stopped river searches

- A timed-out hydrology search throws HydrologySearchTimeoutException carrying the nearest feature found so far
- nearestRiver answers RiverSearch.Stopped with the nearer of that feature and recorded water, and a message saying a nearer one may exist
- Bukkit and modded find river print the stopped message and never teleport on a stopped search
- Both commands catch every throwable while delivering a result and log it before telling the player
- Modded logs a result that cannot reach the server thread instead of dropping it
- The four-argument nearestFeature is removed; tests call the six-argument form
This commit is contained in:
Brian Neumann-Fopiano committed 2026-11-01 21:48:10 -05:00
1 parent 474b1e873a
commit 9afd70e69f
11 files changed
+247 -76

No files matched your search

@@ -240,9 +240,11 @@ public class CommandFind implements DirectorExecutor {
switch (search) {
case GenerationSemanticQueries.RiverSearch.Missing missing ->
sendStructureMessage(request.target(), request.sender(), C.YELLOW + missing.message());
case GenerationSemanticQueries.RiverSearch.Stopped stopped ->
sendStructureMessage(request.target(), request.sender(), C.YELLOW + stopped.message());
case GenerationSemanticQueries.RiverSearch.Found found -> arriveAtRiver(request, found.feature());
}
} catch (RuntimeException error) {
} catch (Throwable error) {
reportRiverFailure(request, error);
}
}
@@ -258,10 +260,10 @@ public class CommandFind implements DirectorExecutor {
}
private void reportRiverFailure(RiverRequest request, Throwable failure) {
Iris.reportError("Could not locate hydrology feature '" + request.type().key() + "'.", failure);
sendStructureMessage(request.target(), request.sender(),
C.RED + "Could not search for " + request.label() + ": " + failure.getClass().getSimpleName()
+ (failure.getMessage() == null ? "" : " - " + failure.getMessage()));
Iris.reportError("Could not locate hydrology feature '" + request.type().key() + "'.", failure);
}
@Director(description = "Find a structure (a vanilla key like minecraft:village_plains or minecraft:stronghold, or an imported iris structure key)", descriptionKey = "iris.director.commandfind.director.find_structure_vanilla_key_like_minecraft_village_plains_minecraft_stronghold_imported_iris", sync = true)