Add the removing of a jail via the ``/jail delete`` command.

This commit is contained in:
graywolf336
2014-02-13 11:26:42 -06:00
parent 950eb638b8
commit 78cc20c2c1
6 changed files with 75 additions and 0 deletions

View File

@ -405,4 +405,26 @@ public class JailIO {
break;
}
}
/**
* Removes a jail from the storage system.
*
* @param name of the jail to remove.
*/
public void removeJail(String name) {
switch(storage) {
case 1:
case 2:
break;
default:
flat.set("jails." + name, null);
try {
flat.save(new File(pl.getDataFolder(), "data.yml"));
} catch (IOException e) {
pl.getLogger().severe("Unable to remove the jail " + name + " from the storage: " + e.getMessage());
}
break;
}
}
}