From 677664d529914cfd56f08d342648d6edf5f97eaf Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Mon, 30 Apr 2012 16:19:11 +0200 Subject: [PATCH] Fix Ticket 43: - loading group region flag --- .../minecraft/worldguard/CRegionManager.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/de/jaschastarke/minecraft/worldguard/CRegionManager.java b/src/de/jaschastarke/minecraft/worldguard/CRegionManager.java index ed25481..14a7836 100644 --- a/src/de/jaschastarke/minecraft/worldguard/CRegionManager.java +++ b/src/de/jaschastarke/minecraft/worldguard/CRegionManager.java @@ -38,6 +38,7 @@ import com.sk89q.worldguard.protection.flags.Flag; import com.sk89q.worldguard.protection.managers.RegionManager; import com.sk89q.worldguard.protection.regions.ProtectedRegion; +import de.jaschastarke.minecraft.limitedcreative.Core; import de.jaschastarke.minecraft.utils.Util; public class CRegionManager { @@ -121,10 +122,19 @@ public class CRegionManager { if (rs.contains("flags")) { ConfigurationSection fs = rs.getConfigurationSection("flags"); for (Map.Entry data : fs.getValues(false).entrySet()) { - Flag flag = FlagList.getFlag(data.getKey()); + Flag flag = null; + if (data.getKey().endsWith("-group")) { + flag = FlagList.getFlag(data.getKey().substring(0, data.getKey().length() - 6)); + if (flag != null) + flag = flag.getRegionGroupFlag(); + } else { + flag = FlagList.getFlag(data.getKey()); + } if (flag != null) { // the flag doesn't exists anymore. just ignore it without error Object value = flag.unmarshal(data.getValue()); list.add(new FlagValue(flag, value)); + } else { + Core.debug("Couldn't load unknown Flag: "+data.getKey()); } } }