Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-09-06 16:12:51 +02:00
Improve requireTag exception messages
e15d7993ada7b26784471bdb0e9550228724d900 Co-Authored-By: Octavia Togami <2093023+octylFractal@users.noreply.github.com>
Dieser Commit ist enthalten in:
Ursprung
d44cceb1e9
Commit
197389bd32
@ -32,12 +32,14 @@ public abstract class NBTSchematicReader implements ClipboardReader {
|
||||
|
||||
protected static <T extends Tag> T requireTag(Map<String, Tag> items, String key, Class<T> expected) throws IOException {
|
||||
if (!items.containsKey(key)) {
|
||||
throw new IOException("Schematic file is missing a \"" + key + "\" tag");
|
||||
throw new IOException("Schematic file is missing a \"" + key + "\" tag of type "
|
||||
+ expected.getName());
|
||||
}
|
||||
|
||||
Tag tag = items.get(key);
|
||||
if (!expected.isInstance(tag)) {
|
||||
throw new IOException(key + " tag is not of tag type " + expected.getName());
|
||||
throw new IOException(key + " tag is not of tag type " + expected.getName() + ", got "
|
||||
+ tag.getClass().getName() + " instead");
|
||||
}
|
||||
|
||||
return expected.cast(tag);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren