Merge branch 'master' of git@github.com:graywolf336/Jail.git

This commit is contained in:
graywolf336 2014-08-25 23:00:56 -05:00
commit 59003f503d

View File

@ -410,6 +410,7 @@ public class JailIO {
j.setTeleportFree(new Location(pl.getServer().getWorld(j.getWorldName()), set.getDouble("tps.free.x"), j.setTeleportFree(new Location(pl.getServer().getWorld(j.getWorldName()), set.getDouble("tps.free.x"),
set.getDouble("tps.free.y"), set.getDouble("tps.free.z"), set.getDouble("tps.free.y"), set.getDouble("tps.free.z"),
set.getFloat("tps.free.yaw"), set.getFloat("tps.free.pitch"))); set.getFloat("tps.free.yaw"), set.getFloat("tps.free.pitch")));
j.setEnabled(j.getWorld() != null);
pl.getJailManager().addJail(j, false); pl.getJailManager().addJail(j, false);
} }
@ -435,6 +436,7 @@ public class JailIO {
Jail j = pl.getJailManager().getJail(set.getString("jail")); Jail j = pl.getJailManager().getJail(set.getString("jail"));
if(j != null) { if(j != null) {
if(j.getWorld() != null) {
Cell c = new Cell(set.getString("name")); Cell c = new Cell(set.getString("name"));
c.setTeleport(new SimpleLocation(j.getWorldName(), set.getDouble("tp.x"), set.getDouble("tp.y"), set.getDouble("tp.z"), c.setTeleport(new SimpleLocation(j.getWorldName(), set.getDouble("tp.x"), set.getDouble("tp.y"), set.getDouble("tp.z"),
set.getFloat("tp.yaw"), set.getFloat("tp.pitch"))); set.getFloat("tp.yaw"), set.getFloat("tp.pitch")));
@ -450,8 +452,10 @@ public class JailIO {
} }
} }
j.addCell(c, false); j.addCell(c, false);
}else {
pl.getLogger().warning("The cell, " + set.getString("name") + ", in " + j.getName() + " is located in a world that is not loaded.");
}
}else { }else {
cellsToRemove.add(set.getInt("cellid")); cellsToRemove.add(set.getInt("cellid"));
} }
@ -713,6 +717,7 @@ public class JailIO {
* @param j The jail to save. * @param j The jail to save.
*/ */
public void saveJail(Jail j) { public void saveJail(Jail j) {
if(j.isEnabled()) {
switch(storage) { switch(storage) {
case 1: case 1:
case 2: case 2:
@ -930,6 +935,7 @@ public class JailIO {
break; break;
} }
} }
}
public void saveCell(Jail j, Cell c) { public void saveCell(Jail j, Cell c) {
switch(storage) { switch(storage) {