mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
Themed boot validation output
- Share pack boot reporting between Bukkit and modded - Cap boot warnings and errors with a pointer to pack validate - Merge refused-world join notices into one report
This commit is contained in:
1 parent
8b98e2a61c
commit
4d0063dd7d
8 files changed
+121
-59
No files matched your search
+11
-30
@@ -27,7 +27,9 @@ import art.arcane.iris.world.lifecycle.WorldLifecycleStaging;
|
||||
import art.arcane.iris.pack.validation.CompatRegistry;
|
||||
import art.arcane.iris.world.lifecycle.WorldReplacementSeed;
|
||||
import art.arcane.iris.pack.loading.IrisData;
|
||||
import art.arcane.iris.localization.ChatReport;
|
||||
import art.arcane.iris.pack.BrokenPackException;
|
||||
import art.arcane.iris.pack.PackBootReporter;
|
||||
import art.arcane.iris.pack.PackDownloader;
|
||||
import art.arcane.iris.pack.PackDirectoryResolver;
|
||||
import art.arcane.iris.pack.PackValidationCache;
|
||||
@@ -82,7 +84,6 @@ import java.util.stream.Stream;
|
||||
*/
|
||||
public final class IrisWorldGeneratorResolver {
|
||||
private static final int VALIDATION_STABILITY_ATTEMPTS = 2;
|
||||
private static final int COMPAT_BOOT_KEY_CAP = 3;
|
||||
private static final Object SNAPSHOT_VALIDATION_LOCK = new Object();
|
||||
private static final String IRIS_DIMENSION_NAMESPACE = "iris";
|
||||
private static final String PLOT_SQUARED_DISCOVERY_WORLD = "CheckingPlotSquaredGenerator";
|
||||
@@ -235,8 +236,6 @@ public final class IrisWorldGeneratorResolver {
|
||||
PackValidationRegistry.publish(packDirectory.toPath(), result, packFingerprint, contextFingerprint);
|
||||
}
|
||||
String minecraftVersion = IrisPlatforms.isBound() ? IrisPlatforms.get().minecraftVersion() : null;
|
||||
String compatSummary = PackValidator.compatSummary(result, minecraftVersion);
|
||||
String compatSuffix = compatSummary.isEmpty() ? "" : " " + compatSummary;
|
||||
if (!result.isLoadable()) {
|
||||
if (hasPendingExternalContent(result, IrisServices.getOrNull(ExternalDataSVC.class))
|
||||
&& packDirectory != null
|
||||
@@ -244,30 +243,12 @@ public final class IrisWorldGeneratorResolver {
|
||||
Iris.info("Pack '" + result.getPackName() + "' is waiting for external block providers to initialize.");
|
||||
continue;
|
||||
}
|
||||
Iris.error("Pack '" + result.getPackName()
|
||||
+ "' FAILED validation - world and Studio creation with this pack will be refused. Reasons:");
|
||||
for (String reason : result.getBlockingErrors()) {
|
||||
Iris.error(" - " + reason);
|
||||
}
|
||||
} else if (!result.getWarnings().isEmpty()) {
|
||||
Iris.info("Pack '" + result.getPackName() + "' validated ("
|
||||
+ result.getWarnings().size() + " warning(s))." + compatSuffix);
|
||||
for (String warning : result.getWarnings()) {
|
||||
Iris.warn(" [" + result.getPackName() + "] " + warning);
|
||||
}
|
||||
} else if (cached.isEmpty()) {
|
||||
if (compatSummary.isEmpty()) {
|
||||
Iris.success("Pack '" + result.getPackName() + "' validated.");
|
||||
} else {
|
||||
Iris.info("Pack '" + result.getPackName() + "' validated." + compatSuffix);
|
||||
}
|
||||
} else if (!compatSummary.isEmpty()) {
|
||||
Iris.info("Pack '" + result.getPackName() + "' validated." + compatSuffix);
|
||||
PackBootReporter.logBroken(result);
|
||||
} else {
|
||||
PackBootReporter.logValidated(result, minecraftVersion, cached.isEmpty());
|
||||
}
|
||||
// Cache hits carry the persisted findings, so the listing prints on every boot, not only after a miss.
|
||||
for (String line : PackValidator.compatBootLines(result, minecraftVersion, COMPAT_BOOT_KEY_CAP)) {
|
||||
Iris.warn(line);
|
||||
}
|
||||
PackBootReporter.logCompat(result, minecraftVersion);
|
||||
}
|
||||
IrisStartupValidation.markPacksReady();
|
||||
}
|
||||
@@ -705,11 +686,11 @@ public final class IrisWorldGeneratorResolver {
|
||||
try {
|
||||
requireSnapshotLoadable(snapshotRoot);
|
||||
} catch (BrokenPackException exception) {
|
||||
Iris.error("Refusing to create world '" + worldName + "' using broken snapshot at '"
|
||||
+ snapshotRoot + "':");
|
||||
for (String reason : exception.getReasons()) {
|
||||
Iris.error(" - " + reason);
|
||||
}
|
||||
ChatReport.of(ChatReport.Tone.ERROR, "Refusing to create world '" + worldName
|
||||
+ "' using broken snapshot at '" + snapshotRoot + "'")
|
||||
.items(exception.getReasons())
|
||||
.build()
|
||||
.log();
|
||||
throw exception;
|
||||
}
|
||||
|
||||
|
||||
+13
-5
@@ -19,7 +19,7 @@
|
||||
package art.arcane.iris.world;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.localization.C;
|
||||
import art.arcane.iris.localization.ChatReport;
|
||||
import art.arcane.iris.world.safeguard.GenerationRefusalNotice;
|
||||
import art.arcane.volmlib.util.bukkit.WorldIdentity;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -84,8 +84,16 @@ public final class WorldRefusalReporter implements Listener {
|
||||
if (!player.isOp() && !player.hasPermission("iris.all")) {
|
||||
return;
|
||||
}
|
||||
for (String notice : operatorNotices.values()) {
|
||||
player.sendMessage(C.RED + notice);
|
||||
ChatReport report = ChatReport.of(ChatReport.Tone.ERROR, operatorNotices.size() == 1
|
||||
? "An Iris world did not load and refuses to generate"
|
||||
: operatorNotices.size() + " Iris worlds did not load and refuse to generate")
|
||||
.items(operatorNotices.values())
|
||||
.hint("The console has the full refusal notice", null)
|
||||
.build();
|
||||
String tag = Iris.instance == null ? "" : Iris.instance.getTag();
|
||||
List<ChatReport.Line> lines = report.lines();
|
||||
for (int index = 0; index < lines.size(); index++) {
|
||||
player.sendMessage((index == 0 ? tag : "") + lines.get(index).text());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +107,8 @@ public final class WorldRefusalReporter implements Listener {
|
||||
for (String line : notice(worldName, key, failure, startupWorldsCreated)) {
|
||||
Iris.error(line);
|
||||
}
|
||||
operatorNotices.put(worldKey == null ? worldName : key, "Iris world '" + worldName + "' (" + key
|
||||
+ ") did not load and refuses to generate: " + GenerationRefusalNotice.summary(failure));
|
||||
operatorNotices.put(worldKey == null ? worldName : key, worldName + " (" + key + "): "
|
||||
+ GenerationRefusalNotice.summary(failure));
|
||||
} catch (Throwable reportingFailure) {
|
||||
System.err.println("[Iris] Iris refused to generate world '" + worldName + "' (" + key
|
||||
+ "); the refusal could not be reported: " + reportingFailure.getClass().getName());
|
||||
|
||||
Reference in new issue
Block a user