Fixed #WORLDGUARD-2289, FlagStateManager is not thread synced with the main thread.

This commit is contained in:
sk89q 2012-11-11 18:36:08 -08:00
parent 93f062d4e3
commit 8f409d47d9

View File

@ -108,6 +108,7 @@ public boolean hasPermission(CommandSender player, String perm) {
/**
* Called on plugin enable.
*/
@Override
@SuppressWarnings("deprecation")
public void onEnable() {
@ -152,7 +153,8 @@ public void run() {
flagStateManager = new FlagStateManager(this);
if (configuration.useRegionsScheduler) {
getServer().getScheduler().scheduleAsyncRepeatingTask(this, flagStateManager, FlagStateManager.RUN_DELAY, FlagStateManager.RUN_DELAY);
getServer().getScheduler().scheduleSyncRepeatingTask(this, flagStateManager,
FlagStateManager.RUN_DELAY, FlagStateManager.RUN_DELAY);
}
// Register events
@ -194,6 +196,7 @@ public void run() {
/**
* Called on plugin disable.
*/
@Override
public void onDisable() {
globalRegionManager.unload();
configuration.unload();