mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-24 08:21:32 +01:00
Add texture-key check. Fixes #53
This commit is contained in:
parent
ebbdd225cc
commit
0fe7cf94a9
@ -269,7 +269,6 @@ private BlockModelResource buildNoReset(String modelPath, boolean renderElements
|
||||
|
||||
for (Entry<Object, ? extends ConfigurationNode> entry : config.getNode("textures").getChildrenMap().entrySet()) {
|
||||
if (entry.getKey().equals(JSON_COMMENT)) continue;
|
||||
|
||||
textures.putIfAbsent(entry.getKey().toString(), entry.getValue().getString(null));
|
||||
}
|
||||
|
||||
@ -426,6 +425,8 @@ private Vector4f readVector4f(ConfigurationNode node) throws ParseResourceExcept
|
||||
}
|
||||
|
||||
private Texture getTexture(String key) throws NoSuchElementException, FileNotFoundException, IOException {
|
||||
if (key.isEmpty() || key.equals("#")) throw new NoSuchElementException("Empty texture key or name!");
|
||||
|
||||
if (key.charAt(0) == '#') {
|
||||
String value = textures.get(key.substring(1));
|
||||
if (value == null) throw new NoSuchElementException("There is no texture defined for the key " + key);
|
||||
|
Loading…
Reference in New Issue
Block a user