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. * Called on plugin enable.
*/ */
@Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void onEnable() { public void onEnable() {
@ -152,7 +153,8 @@ public void run() {
flagStateManager = new FlagStateManager(this); flagStateManager = new FlagStateManager(this);
if (configuration.useRegionsScheduler) { 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 // Register events
@ -194,6 +196,7 @@ public void run() {
/** /**
* Called on plugin disable. * Called on plugin disable.
*/ */
@Override
public void onDisable() { public void onDisable() {
globalRegionManager.unload(); globalRegionManager.unload();
configuration.unload(); configuration.unload();