diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java b/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java index e0c2f6d8..23b2dc5a 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java @@ -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(); diff --git a/src/com/sk89q/worldguard/protection/regions/flags/Flags.java b/src/com/sk89q/worldguard/protection/regions/flags/Flags.java index 9602cffd..c0d3ef9f 100644 --- a/src/com/sk89q/worldguard/protection/regions/flags/Flags.java +++ b/src/com/sk89q/worldguard/protection/regions/flags/Flags.java @@ -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++; + } }