mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Merge branch 'schnautzr-master-patch-51486' into 'master'
Collector Number Sort update for RNA See merge request core-developers/forge!1297
This commit is contained in:
@@ -567,16 +567,24 @@ public enum ColumnDef {
|
|||||||
private static String toLandsLast(final InventoryItem i) {
|
private static String toLandsLast(final InventoryItem i) {
|
||||||
//nonland?
|
//nonland?
|
||||||
return !(((IPaperCard) i).getRules().getType().isLand()) ?
|
return !(((IPaperCard) i).getRules().getType().isLand()) ?
|
||||||
"0" + toColorlessArtifactsLast(i)
|
"0" + toArtifactsWithColorlessCostsLast(i)
|
||||||
//land
|
//land
|
||||||
: "1";
|
: "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Returns 1 for colorless artifacts, otherwise 0 and continues sorting.
|
/**Returns 1 for artifacts without color shards in their mana cost, otherwise 0 and continues sorting.
|
||||||
|
As of 2019, colored artifacts appear here if there are no colored shards in their casting cost.
|
||||||
@param i A paper card.
|
@param i A paper card.
|
||||||
@return Part of a sortable numeric string.*/
|
@return Part of a sortable numeric string.*/
|
||||||
private static String toColorlessArtifactsLast(final InventoryItem i) {
|
private static String toArtifactsWithColorlessCostsLast(final InventoryItem i) {
|
||||||
return !(((IPaperCard) i).getRules().getType().isArtifact() && toColor(i).isColorless())
|
forge.card.mana.ManaCost manaCost = ((IPaperCard) i).getRules().getManaCost();
|
||||||
|
|
||||||
|
return !(((IPaperCard) i).getRules().getType().isArtifact() && (toColor(i).isColorless() ||
|
||||||
|
//If it isn't colorless, see if it can be paid with only white, only blue, only black.
|
||||||
|
//No need to check others since three-color hybrid shards don't exist.
|
||||||
|
manaCost.canBePaidWithAvaliable(MagicColor.WHITE) &&
|
||||||
|
manaCost.canBePaidWithAvaliable(MagicColor.BLUE) &&
|
||||||
|
manaCost.canBePaidWithAvaliable(MagicColor.BLACK)))
|
||||||
? "0" + toSplitLast(i): "1";
|
? "0" + toSplitLast(i): "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user