mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-03 19:51:49 +00:00
Loot validation names why a table cannot be read
The validator reports the load's reason (such as a field of the wrong type) instead of pointing at the log.
This commit is contained in:
1 parent
bd7c1a226a
commit
74d83b5be1
1 file changed
+2
-2
@@ -41,7 +41,7 @@ import java.util.function.BiFunction;
|
|||||||
/**
|
/**
|
||||||
* Module {@code iris:loot}'s check of a pack: every loot table has sane picks, tries and entries, and every loot
|
* Module {@code iris:loot}'s check of a pack: every loot table has sane picks, tries and entries, and every loot
|
||||||
* reference of a dimension, region or biome names a table the pack has. It checks the tables and settings as they
|
* reference of a dimension, region or biome names a table the pack has. It checks the tables and settings as they
|
||||||
* decoded; a file that is not valid JSON, or holds a value of the wrong type, is reported by the load that reads it.
|
* decoded; a file that is not valid JSON, or holds a value of the wrong type, fails to load, and the check reports why.
|
||||||
*/
|
*/
|
||||||
public final class LootValidator implements Validator {
|
public final class LootValidator implements Validator {
|
||||||
private static final String JSON_EXTENSION = ".json";
|
private static final String JSON_EXTENSION = ".json";
|
||||||
@@ -95,7 +95,7 @@ public final class LootValidator implements Validator {
|
|||||||
try {
|
try {
|
||||||
return resources.find(LootResources.TABLES.key(id)).orElse(null);
|
return resources.find(LootResources.TABLES.key(id)).orElse(null);
|
||||||
} catch (IllegalStateException failedToLoad) {
|
} catch (IllegalStateException failedToLoad) {
|
||||||
errors.add("Loot table '" + key + "' cannot be read; the log says what is wrong with the file.");
|
errors.add("Loot table '" + key + "' cannot be read: " + failedToLoad.getMessage());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user