From 1c6f3f28d1d31814fa94588c87a68dcbc2d49ce9 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 8 Nov 2015 17:59:32 +0100 Subject: [PATCH] Call changed() more often --- .../massivecraft/factions/cmd/CmdFactionsInviteAdd.java | 1 + .../factions/cmd/CmdFactionsInviteRemove.java | 4 ++++ .../factions/cmd/CmdFactionsRelationAbstract.java | 3 +++ src/com/massivecraft/factions/entity/Faction.java | 9 ++++++--- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java index 5b2ab7fe..e5f1e3dc 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java @@ -72,6 +72,7 @@ public class CmdFactionsInviteAdd extends FactionsCommand // Apply msenderFaction.setInvited(mplayer, true); + msenderFaction.changed(); } else { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java index c2535990..24367f9b 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java @@ -109,6 +109,9 @@ public class CmdFactionsInviteRemove extends FactionsCommand // Apply msenderFaction.setInvited(mplayer, false); + + // If all, we do this at last. So we only do it once. + if (! all) msenderFaction.changed(); } else { @@ -143,6 +146,7 @@ public class CmdFactionsInviteRemove extends FactionsCommand ); msenderFaction.sendMessage(factionsRevokeAll); + msenderFaction.changed(); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java index cad13ef0..9a5730ba 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java @@ -119,6 +119,9 @@ public abstract class CmdFactionsRelationAbstract extends FactionsCommand otherFaction.msg("This will have no effect while their faction is peaceful."); msenderFaction.msg("This will have no effect while your faction is peaceful."); } + + // Mark as changed + msenderFaction.changed(); } } diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index 8fac37b4..ff534ea1 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -868,17 +868,20 @@ public class Faction extends Entity implements EconomyParticipator, Nam Map> perms = this.getPerms(); Set rels = perms.get(perm); - + + boolean changed; if (permitted) { - rels.add(rel); + changed = rels.add(rel); } else { - rels.remove(rel); + changed = rels.remove(rel); } this.setPerms(perms); + + if (changed) this.changed(); } // -------------------------------------------- //