Don't save the cell when we are loading it.

This commit is contained in:
graywolf336 2013-12-09 16:35:10 -06:00
parent 7743897b9d
commit 89dbc4d2be
3 changed files with 4 additions and 3 deletions

View File

@ -209,6 +209,7 @@ public class JailIO {
c.setPrisoner(p);
}
j.addCell(c, false);
}
}else {
pl.getLogger().warning("Cell configuration section for " + name + " exists but no cells are there.");

View File

@ -130,8 +130,8 @@ public class Jail {
}
/** Adds a cell to the Jail. */
public void addCell(Cell cell) {
plugin.getJailIO().saveJail(this);
public void addCell(Cell cell, boolean save) {
if(save) plugin.getJailIO().saveJail(this);
this.cells.put(cell.getName(), cell);
}

View File

@ -138,7 +138,7 @@ public class CellCreationSteps {
c.setTeleport(cp.getTeleportInSL());
c.setChestLocation(cp.getChestLocation());
j.addCell(c);
j.addCell(c, true);
jm.removeCellCreationPlayer(player.getName());
jm.addCreatingCell(player.getName(), j.getName(), "cell_n" + (j.getCellCount() + 1));