diff --git a/capes/ally.png b/capes/ally.png deleted file mode 100644 index 83deef32..00000000 Binary files a/capes/ally.png and /dev/null differ diff --git a/capes/capes.psd b/capes/capes.psd deleted file mode 100644 index 7739624e..00000000 Binary files a/capes/capes.psd and /dev/null differ diff --git a/capes/enemy.png b/capes/enemy.png deleted file mode 100644 index 0e779b36..00000000 Binary files a/capes/enemy.png and /dev/null differ diff --git a/capes/member.png b/capes/member.png deleted file mode 100644 index 9b27e576..00000000 Binary files a/capes/member.png and /dev/null differ diff --git a/capes/neutral.png b/capes/neutral.png deleted file mode 100644 index 949df649..00000000 Binary files a/capes/neutral.png and /dev/null differ diff --git a/capes/peaceful.png b/capes/peaceful.png deleted file mode 100644 index b1788133..00000000 Binary files a/capes/peaceful.png and /dev/null differ diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index c89043e9..da3b2b97 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -43,11 +43,11 @@ public class Faction extends Entity implements EconomyParticipator @Override public Faction load(Faction that) { - this.tag = that.tag; + this.setTag(that.tag); this.setDescription(that.description); - this.home = that.home; + this.setHome(that.home); this.setPowerBoost(that.powerBoost); - this.open = that.open; + this.setOpen(that.open); this.setInvitedPlayerIds(that.invitedPlayerIds); this.setRelationWishes(that.relationWish); this.setFlags(that.flagOverrides); @@ -238,6 +238,7 @@ public class Faction extends Entity implements EconomyParticipator public void setHome(PS home) { this.home = home; + this.changed(); } // -------------------------------------------- // @@ -255,10 +256,7 @@ public class Faction extends Entity implements EconomyParticipator public void setPowerBoost(Double powerBoost) { - if (powerBoost == null || powerBoost == 0) - { - powerBoost = null; - } + if (powerBoost == null || powerBoost == 0) powerBoost = null; this.powerBoost = powerBoost; this.changed(); } @@ -470,13 +468,16 @@ public class Faction extends Entity implements EconomyParticipator target.putAll(flags); } - Iterator> iter = target.entrySet().iterator(); - while (iter.hasNext()) + if (this.attached() && Factions.get().isDatabaseInitialized()) { - Entry entry = iter.next(); - if (entry.getKey().getDefault(this) == entry.getValue()) + Iterator> iter = target.entrySet().iterator(); + while (iter.hasNext()) { - iter.remove(); + Entry entry = iter.next(); + if (entry.getKey().getDefault(this) == entry.getValue()) + { + iter.remove(); + } } } @@ -542,13 +543,16 @@ public class Faction extends Entity implements EconomyParticipator } } - Iterator>> iter = target.entrySet().iterator(); - while (iter.hasNext()) + if (this.attached() && Factions.get().isDatabaseInitialized()) { - Entry> entry = iter.next(); - if (entry.getKey().getDefault(this).equals(entry.getValue())) + Iterator>> iter = target.entrySet().iterator(); + while (iter.hasNext()) { - iter.remove(); + Entry> entry = iter.next(); + if (entry.getKey().getDefault(this).equals(entry.getValue())) + { + iter.remove(); + } } } diff --git a/src/com/massivecraft/factions/entity/UPlayer.java b/src/com/massivecraft/factions/entity/UPlayer.java index 917a5eb5..fb63f713 100644 --- a/src/com/massivecraft/factions/entity/UPlayer.java +++ b/src/com/massivecraft/factions/entity/UPlayer.java @@ -20,7 +20,6 @@ import com.massivecraft.mcore.mixin.Mixin; import com.massivecraft.mcore.ps.PS; import com.massivecraft.mcore.ps.PSFormatSlug; import com.massivecraft.mcore.store.SenderEntity; -import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.util.SenderUtil; @@ -186,24 +185,18 @@ public class UPlayer extends SenderEntity implements EconomyParticipato // This setter is so long because it search for default/null case and takes care of updating the faction member index public void setFactionId(String factionId) { - // Avoid null input - if (factionId == null) factionId = this.getDefaultFactionId(); - - // Get the old value - String oldFactionId = this.getFactionId(); - - // Ignore nochange - if (factionId.equals(oldFactionId)) return; + // Get the raw old value + String oldFactionId = this.factionId; // Apply change - if (factionId.equals(this.getDefaultFactionId())) factionId = null; this.factionId = factionId; // Next we must be attached and inited if (!this.attached()) return; - if (!this.getColl().inited()) return; if (!Factions.get().isDatabaseInitialized()) return; + if (oldFactionId == null) oldFactionId = this.getDefaultFactionId(); + // Update index Faction oldFaction = FactionColls.get().get(this).get(oldFactionId); Faction faction = FactionColls.get().get(this).get(factionId); @@ -237,7 +230,6 @@ public class UPlayer extends SenderEntity implements EconomyParticipato public void setRole(Rel role) { - if (role == null || MUtil.equals(role, this.getDefaultRole())) role = null; this.role = role; this.changed(); } @@ -328,8 +320,6 @@ public class UPlayer extends SenderEntity implements EconomyParticipato public void setPower(Double power) { - if (power == null || MUtil.equals(power, this.getDefaultPower())) power = null; - power = this.getLimitedPower(power); this.power = power; this.changed(); }