Add jail timer and jail event, count down the prisoners time.

This commit is contained in:
graywolf336
2014-01-03 14:10:38 -06:00
parent 738f8bc057
commit f5bf76ec46
9 changed files with 164 additions and 5 deletions

View File

@ -25,6 +25,7 @@ public class JailMain extends JavaPlugin {
private HandCuffManager hcm;
private JailIO io;
private JailManager jm;
private JailTimer jt;
private PrisonerManager pm;
private boolean debug = false;
@ -47,12 +48,13 @@ public class JailMain extends JavaPlugin {
plm.registerEvents(new HandCuffListener(this), this);
plm.registerEvents(new PlayerListener(this), this);
jt = new JailTimer(this);
debug = getConfig().getBoolean(Settings.DEBUG.getPath());
if(debug) getLogger().info("Debugging enabled.");
//For the time, we will use:
//http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TimeUnit.html#convert(long, java.util.concurrent.TimeUnit)
getLogger().info("Successfully loaded, is our impression.");
}
public void onDisable() {
@ -60,6 +62,10 @@ public class JailMain extends JavaPlugin {
for(Jail j : jm.getJails())
io.saveJail(j);
if(jt != null)
if(jt.getTimer() != null)
jt.getTimer().stop();
cmdHand = null;
pm = null;
jm = null;