From 89dbc4d2be1e6da12396657736b5e960663e4b2b Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Mon, 9 Dec 2013 16:35:10 -0600 Subject: [PATCH] Don't save the cell when we are loading it. --- src/main/java/com/graywolf336/jail/JailIO.java | 1 + src/main/java/com/graywolf336/jail/beans/Jail.java | 4 ++-- .../java/com/graywolf336/jail/steps/CellCreationSteps.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/graywolf336/jail/JailIO.java b/src/main/java/com/graywolf336/jail/JailIO.java index 21733c3..aecfcb2 100644 --- a/src/main/java/com/graywolf336/jail/JailIO.java +++ b/src/main/java/com/graywolf336/jail/JailIO.java @@ -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."); diff --git a/src/main/java/com/graywolf336/jail/beans/Jail.java b/src/main/java/com/graywolf336/jail/beans/Jail.java index 93f0b79..7df1d92 100644 --- a/src/main/java/com/graywolf336/jail/beans/Jail.java +++ b/src/main/java/com/graywolf336/jail/beans/Jail.java @@ -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); } diff --git a/src/main/java/com/graywolf336/jail/steps/CellCreationSteps.java b/src/main/java/com/graywolf336/jail/steps/CellCreationSteps.java index 7073343..926d262 100644 --- a/src/main/java/com/graywolf336/jail/steps/CellCreationSteps.java +++ b/src/main/java/com/graywolf336/jail/steps/CellCreationSteps.java @@ -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));