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.collections.MassiveList;
import com.massivecraft.massivecore.collections.MassiveMapDef;
import com.massivecraft.massivecore.collections.MassiveSet;
import com.massivecraft.massivecore.collections.MassiveTreeSetDef;
import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive;
import com.massivecraft.massivecore.mixin.MixinMessage;
@ -1008,7 +1009,8 @@ public class Faction extends Entity<Faction> implements EconomyParticipator, Nam
// FOREIGN KEY: MPLAYER
// -------------------------------------------- //
protected transient List<MPlayer> mplayers = new ArrayList<MPlayer>();
protected transient Set<MPlayer> mplayers = new MassiveSet<MPlayer>();
public void reindexMPlayers()
{
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)
{
Faction before = mplayer.getFaction();
Faction after = null;
mplayer.updateFactionIndexes(before, after);
String beforeId = mplayer.getFactionId();
String afterId = null;
mplayer.updateFactionIndexes(beforeId, afterId);
}
return super.removeAtLocalFixed(id);
@ -63,20 +63,20 @@ public class MPlayerColl extends SenderColl<MPlayer>
MPlayer mplayer = null;
// Before
Faction before = null;
String beforeId = null;
if (mplayer == null) mplayer = this.id2entity.get(id);
if (mplayer != null) before = mplayer.getFaction();
if (mplayer != null) beforeId = mplayer.getFactionId();
// Super
super.loadFromRemoteFixed(id, remoteEntry);
// After
Faction after = null;
String afterId = null;
if (mplayer == null) mplayer = this.id2entity.get(id);
if (mplayer != null) after = mplayer.getFaction();
if (mplayer != null) afterId = mplayer.getFactionId();
// Perform
if (mplayer != null) mplayer.updateFactionIndexes(before, after);
if (mplayer != null) mplayer.updateFactionIndexes(beforeId, afterId);
}
// -------------------------------------------- //