Work on the tests and change up some performance issues.
1. In the player move event we looped through the jailed players more than once which really is an issue when you have several hundred jailed and since the move event is called several times a second, that was a huge performance hit. 2. Don't save the prisoner data as soon as they are jailed, we take care of that else where with the shutting down and counting down time.
This commit is contained in:
@ -38,6 +38,7 @@ public class JailMain extends JavaPlugin {
|
||||
private JailTimer jt;
|
||||
private PrisonerManager pm;
|
||||
private ScoreBoardManager sbm;
|
||||
private MoveProtectionListener mpl;
|
||||
private boolean debug = false;
|
||||
|
||||
public void onEnable() {
|
||||
@ -94,7 +95,8 @@ public class JailMain extends JavaPlugin {
|
||||
//But doing this also forces people to restart their server if they to
|
||||
//enable it after disabling it.
|
||||
if(getConfig().getBoolean(Settings.MOVEPROTECTION.getPath())) {
|
||||
plm.registerEvents(new MoveProtectionListener(this), this);
|
||||
this.mpl = new MoveProtectionListener(this);
|
||||
plm.registerEvents(this.mpl, this);
|
||||
}
|
||||
|
||||
jt = new JailTimer(this);
|
||||
@ -262,4 +264,8 @@ public class JailMain extends JavaPlugin {
|
||||
public void debug(String message) {
|
||||
if(inDebug()) getLogger().info("[Debug]: " + message);
|
||||
}
|
||||
|
||||
public MoveProtectionListener getPlayerMoveListener() {
|
||||
return this.mpl;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user