diff --git a/src/nl/evolutioncoding/areashop/FileManager.java b/src/nl/evolutioncoding/areashop/FileManager.java index 368ef49..5bf647e 100644 --- a/src/nl/evolutioncoding/areashop/FileManager.java +++ b/src/nl/evolutioncoding/areashop/FileManager.java @@ -483,6 +483,7 @@ public class FileManager { * Save the group file to disk */ public void saveGroupsIsRequired() { + AreaShop.debug("saveGroupsRequired() set"); saveGroupsRequired = true; } public boolean isSaveGroupsRequired() { @@ -490,6 +491,7 @@ public class FileManager { } public void saveGroupsNow() { + AreaShop.debug("saveGroupsNow() done"); saveGroupsRequired = false; try { groupsConfig.save(groupsPath); diff --git a/src/nl/evolutioncoding/areashop/regions/RegionGroup.java b/src/nl/evolutioncoding/areashop/regions/RegionGroup.java index 175944e..4ee312a 100644 --- a/src/nl/evolutioncoding/areashop/regions/RegionGroup.java +++ b/src/nl/evolutioncoding/areashop/regions/RegionGroup.java @@ -23,6 +23,7 @@ public class RegionGroup { setSetting("name", name); // Delete duplicates List members = getMembers(); + int previousCount = members.size(); List newMembers = new ArrayList(); while(!members.isEmpty()) { String member = members.remove(0); @@ -34,8 +35,9 @@ public class RegionGroup { members.remove(member); } } - if(newMembers.size() != members.size()) { + if(newMembers.size() != previousCount) { setSetting("regions", newMembers); + AreaShop.debug("group save required because of changed member size"); saveRequired(); } if(getMembers().size() == 0) { @@ -55,8 +57,6 @@ public class RegionGroup { } else { members.add(region.getName()); setSetting("regions", members); - region.updateSigns(); - region.updateRegionFlags(); return true; } } @@ -75,8 +75,6 @@ public class RegionGroup { } else { setSetting("regions", members); } - region.updateSigns(); - region.updateRegionFlags(); return result; }