make sure the Flags class is always loaded on startup

This commit is contained in:
Redecouverte 2011-03-02 17:37:31 +01:00
parent 3bf18c41bb
commit 1c5ae9ef67
2 changed files with 15 additions and 0 deletions

View File

@ -22,6 +22,7 @@
import com.sk89q.worldguard.bukkit.commands.CommandHandler;
import com.sk89q.worldguard.protection.TimedFlagsTimer;
import com.sk89q.worldguard.protection.regionmanager.GlobalRegionManager;
import com.sk89q.worldguard.protection.regions.flags.Flags;
import java.util.logging.Logger;
/**
@ -52,6 +53,8 @@ public class WorldGuardPlugin extends JavaPlugin {
*/
public void onEnable() {
Flags.Init();
getDataFolder().mkdirs();
globalRegionManager.onEnable();

View File

@ -74,4 +74,16 @@ public enum FlagType {
// RegionGroup flags
public static RegionGroupRegionFlagInfo TELE_PERM = new RegionGroupRegionFlagInfo("teleperm", FlagType.TELE_PERM);
public static RegionGroupRegionFlagInfo SPAWN_PERM = new RegionGroupRegionFlagInfo("spawnperm", FlagType.SPAWN_PERM);
private static Integer initCount = 0;
public static void Init()
{
// this will init all static fields
// change some field's value to make sure this function
// is not erased for optimization
initCount++;
}
}