Only reset WorldGuard flag/groupFlag if not already empty

This commit is contained in:
Thijs Wiefferink 2017-06-12 22:05:09 +02:00
parent 07e6782714
commit b835c4dded

View File

@ -131,8 +131,10 @@ public class WorldGuardRegionFlagsFeature extends RegionFeature {
}
RegionGroupFlag groupFlag = foundFlag.getRegionGroupFlag();
if(value == null || value.isEmpty()) {
worldguardRegion.setFlag(foundFlag, null);
if(groupFlag != null) {
if(worldguardRegion.getFlag(foundFlag) != null) {
worldguardRegion.setFlag(foundFlag, null);
}
if(groupFlag != null && worldguardRegion.getFlag(groupFlag) != null) {
worldguardRegion.setFlag(groupFlag, null);
}
//AreaShop.debug(" Flag " + flagName + " reset (+ possible group of flag)");