Fail earlier when loading a gate configuration with invalid materials
This commit is contained in:
parent
a182a18ee9
commit
22b461e7b4
@ -340,6 +340,9 @@ public class Gate {
|
|||||||
if (key.length() == 1) {
|
if (key.length() == 1) {
|
||||||
Character symbol = key.charAt(0);
|
Character symbol = key.charAt(0);
|
||||||
Material id = Material.getMaterial(value);
|
Material id = Material.getMaterial(value);
|
||||||
|
if(id == null) {
|
||||||
|
throw new Exception("Invalid material in line: " + line);
|
||||||
|
}
|
||||||
types.put(symbol, id);
|
types.put(symbol, id);
|
||||||
frameTypes.add(id);
|
frameTypes.add(id);
|
||||||
} else {
|
} else {
|
||||||
@ -349,7 +352,7 @@ public class Gate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Stargate.log.log(Level.SEVERE, "Could not load Gate " + file.getName() + " - Invalid block ID given");
|
Stargate.log.log(Level.SEVERE, "Could not load Gate " + file.getName() + " - " + ex.getMessage());
|
||||||
return null;
|
return null;
|
||||||
} finally {
|
} finally {
|
||||||
if (scanner != null) scanner.close();
|
if (scanner != null) scanner.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user