Save the Jail when we add it.

This commit is contained in:
graywolf336 2013-12-06 21:50:22 -06:00
parent af9d1a1f5b
commit 7976dec870
2 changed files with 276 additions and 270 deletions

View File

@ -58,9 +58,15 @@ public class JailManager {
return this.jails.keySet().toArray(new String[jails.size()]);
}
/** Adds a jail to the collection of them. */
public void addJail(Jail jail) {
/**
* Adds a jail to the collection of them.
*
* @param jail The jail to add
* @param n True if this is a new jail, false if it isn't.
*/
public void addJail(Jail jail, boolean n) {
this.jails.put(jail.getName(), jail);
if(n) plugin.getJailIO().saveJail(jail);
}
/**

View File

@ -135,7 +135,7 @@ public class JailCreationSteps {
jail.setTeleportIn(cp.getTeleportInSL());
jail.setTeleportFree(cp.getTeleportFreeSL());
jm.addJail(jail);
jm.addJail(jail, true);
p.sendMessage(ChatColor.GREEN + "Jail (" + jail.getName() + ") created successfully!");