Previous commit gave duplicates. Lets try this.

This commit is contained in:
Olof Larsson 2016-08-03 12:51:06 +02:00
parent 6599aac488
commit 3bd67f5029
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474
3 changed files with 225 additions and 228 deletions

View File

@ -29,6 +29,7 @@ import com.massivecraft.factions.util.RelationUtil;
import com.massivecraft.massivecore.Named; import com.massivecraft.massivecore.Named;
import com.massivecraft.massivecore.collections.MassiveList; import com.massivecraft.massivecore.collections.MassiveList;
import com.massivecraft.massivecore.collections.MassiveMapDef; import com.massivecraft.massivecore.collections.MassiveMapDef;
import com.massivecraft.massivecore.collections.MassiveSet;
import com.massivecraft.massivecore.collections.MassiveTreeSetDef; import com.massivecraft.massivecore.collections.MassiveTreeSetDef;
import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive; import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive;
import com.massivecraft.massivecore.mixin.MixinMessage; import com.massivecraft.massivecore.mixin.MixinMessage;
@ -1008,7 +1009,8 @@ public class Faction extends Entity<Faction> implements EconomyParticipator, Nam
// FOREIGN KEY: MPLAYER // FOREIGN KEY: MPLAYER
// -------------------------------------------- // // -------------------------------------------- //
protected transient List<MPlayer> mplayers = new ArrayList<MPlayer>(); protected transient Set<MPlayer> mplayers = new MassiveSet<MPlayer>();
public void reindexMPlayers() public void reindexMPlayers()
{ {
this.mplayers.clear(); this.mplayers.clear();

File diff suppressed because it is too large Load Diff

View File

@ -43,9 +43,9 @@ public class MPlayerColl extends SenderColl<MPlayer>
if (mplayer != null) if (mplayer != null)
{ {
Faction before = mplayer.getFaction(); String beforeId = mplayer.getFactionId();
Faction after = null; String afterId = null;
mplayer.updateFactionIndexes(before, after); mplayer.updateFactionIndexes(beforeId, afterId);
} }
return super.removeAtLocalFixed(id); return super.removeAtLocalFixed(id);
@ -63,20 +63,20 @@ public class MPlayerColl extends SenderColl<MPlayer>
MPlayer mplayer = null; MPlayer mplayer = null;
// Before // Before
Faction before = null; String beforeId = null;
if (mplayer == null) mplayer = this.id2entity.get(id); if (mplayer == null) mplayer = this.id2entity.get(id);
if (mplayer != null) before = mplayer.getFaction(); if (mplayer != null) beforeId = mplayer.getFactionId();
// Super // Super
super.loadFromRemoteFixed(id, remoteEntry); super.loadFromRemoteFixed(id, remoteEntry);
// After // After
Faction after = null; String afterId = null;
if (mplayer == null) mplayer = this.id2entity.get(id); if (mplayer == null) mplayer = this.id2entity.get(id);
if (mplayer != null) after = mplayer.getFaction(); if (mplayer != null) afterId = mplayer.getFactionId();
// Perform // Perform
if (mplayer != null) mplayer.updateFactionIndexes(before, after); if (mplayer != null) mplayer.updateFactionIndexes(beforeId, afterId);
} }
// -------------------------------------------- // // -------------------------------------------- //