Rank rework

This makes an under the hood rank-rework. Nothing is changed from the player perspective.
This commit is contained in:
Magnus Ulf
2018-12-20 01:35:30 +01:00
parent d7728f3a79
commit f347c1058a
33 changed files with 972 additions and 630 deletions

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.comparator;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.Rank;
import com.massivecraft.massivecore.Named;
import com.massivecraft.massivecore.comparator.ComparatorAbstract;
@@ -28,9 +28,10 @@ public class ComparatorMPlayerRole extends ComparatorAbstract<MPlayer> implement
public int compareInner(MPlayer m1, MPlayer m2)
{
// Rank
Rel r1 = m1.getRole();
Rel r2 = m2.getRole();
return r2.getValue() - r1.getValue();
if (m1.getFaction() != m2.getFaction()) throw new IllegalArgumentException("Noncomparable players");
Rank r1 = m1.getRank();
Rank r2 = m2.getRank();
return r2.getPriority() - r1.getPriority() ;
}
}