Fix Spacecraft type collision (#8024)

This commit is contained in:
tool4ever
2025-07-13 18:39:06 +00:00
committed by GitHub
parent d59ec1527d
commit 1c6b256268

View File

@@ -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