mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Fix Spacecraft type collision (#8024)
This commit is contained in:
@@ -659,33 +659,36 @@ public final class CardType implements Comparable<CardType>, CardTypeView {
|
|||||||
if (subtypes.isEmpty()) {
|
if (subtypes.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isCreature() && !isKindred()) {
|
Predicate<String> allowedTypes = x -> false;
|
||||||
subtypes.removeIf(Predicates.IS_CREATURE_TYPE);
|
if (isCreature() || isKindred()) {
|
||||||
|
allowedTypes = allowedTypes.or(Predicates.IS_CREATURE_TYPE);
|
||||||
}
|
}
|
||||||
if (!isLand()) {
|
if (isLand()) {
|
||||||
subtypes.removeIf(Predicates.IS_LAND_TYPE);
|
allowedTypes = allowedTypes.or(Predicates.IS_LAND_TYPE);
|
||||||
}
|
}
|
||||||
if (!isArtifact()) {
|
if (isArtifact()) {
|
||||||
subtypes.removeIf(Predicates.IS_ARTIFACT_TYPE);
|
allowedTypes = allowedTypes.or(Predicates.IS_ARTIFACT_TYPE);
|
||||||
}
|
}
|
||||||
if (!isEnchantment()) {
|
if (isEnchantment()) {
|
||||||
subtypes.removeIf(Predicates.IS_ENCHANTMENT_TYPE);
|
allowedTypes = allowedTypes.or(Predicates.IS_ENCHANTMENT_TYPE);
|
||||||
}
|
}
|
||||||
if (!isInstant() && !isSorcery()) {
|
if (isInstant() || isSorcery()) {
|
||||||
subtypes.removeIf(Predicates.IS_SPELL_TYPE);
|
allowedTypes = allowedTypes.or(Predicates.IS_SPELL_TYPE);
|
||||||
}
|
}
|
||||||
if (!isPlaneswalker()) {
|
if (isPlaneswalker()) {
|
||||||
subtypes.removeIf(Predicates.IS_WALKER_TYPE);
|
allowedTypes = allowedTypes.or(Predicates.IS_WALKER_TYPE);
|
||||||
}
|
}
|
||||||
if (!isDungeon()) {
|
if (isDungeon()) {
|
||||||
subtypes.removeIf(Predicates.IS_DUNGEON_TYPE);
|
allowedTypes = allowedTypes.or(Predicates.IS_DUNGEON_TYPE);
|
||||||
}
|
}
|
||||||
if (!isBattle()) {
|
if (isBattle()) {
|
||||||
subtypes.removeIf(Predicates.IS_BATTLE_TYPE);
|
allowedTypes = allowedTypes.or(Predicates.IS_BATTLE_TYPE);
|
||||||
}
|
}
|
||||||
if (!isPlane()) {
|
if (isPlane()) {
|
||||||
subtypes.removeIf(Predicates.IS_PLANAR_TYPE);
|
allowedTypes = allowedTypes.or(Predicates.IS_PLANAR_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subtypes.removeIf(allowedTypes.negate());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user