Log a severe message to the console when a jail's world is not defined.

This should help warn to warn people when their server starts and
something is wrong with the definition of their jail in the data.yml,
thanks to #40 for raising this issue even though the real issue hasn't
been found.
This commit is contained in:
graywolf336 2015-01-26 00:27:49 -06:00
parent 14b55a81f5
commit 6653ccfb79

View File

@ -597,6 +597,11 @@ public class JailIO {
String cNode = node + "cells."; String cNode = node + "cells.";
Jail j = new Jail(pl, name); Jail j = new Jail(pl, name);
if(flat.getString(node + "world").isEmpty()) {
pl.getLogger().severe("Failed to load the jail, " + name + ", because the world is not set.");
return;
}
j.setWorld(flat.getString(node + "world")); j.setWorld(flat.getString(node + "world"));
j.setMaxPoint(new int[] {flat.getInt(node + "top.x"), flat.getInt(node + "top.y"), flat.getInt(node + "top.z")}); j.setMaxPoint(new int[] {flat.getInt(node + "top.x"), flat.getInt(node + "top.y"), flat.getInt(node + "top.z")});
j.setMinPoint(new int[] {flat.getInt(node + "bottom.x"), flat.getInt(node + "bottom.y"), flat.getInt(node + "bottom.z")}); j.setMinPoint(new int[] {flat.getInt(node + "bottom.x"), flat.getInt(node + "bottom.y"), flat.getInt(node + "bottom.z")});