Merge branch 'oath-of-nissa-fix' into 'master'

Conversion matrices weren't setup properly.

See merge request core-developers/forge!3298
This commit is contained in:
Michael Kamensky
2020-10-28 04:27:19 +00:00
2 changed files with 17 additions and 8 deletions

View File

@@ -139,16 +139,22 @@ public final class MagicColor {
public static final ImmutableList<String> SNOW_LANDS = ImmutableList.of("Snow-Covered Plains", "Snow-Covered Island", "Snow-Covered Swamp", "Snow-Covered Mountain", "Snow-Covered Forest");
public static final ImmutableMap<String, String> ANY_COLOR_CONVERSION = new ImmutableMap.Builder<String, String>()
.put("ManaColorConversion", "Additive")
.put("WhiteConversion", "All")
.put("BlueConversion", "All")
.put("BlackConversion", "All")
.put("RedConversion", "All")
.put("GreenConversion", "All")
.put("WhiteConversion", "Color")
.put("BlueConversion", "Color")
.put("BlackConversion", "Color")
.put("RedConversion", "Color")
.put("GreenConversion", "Color")
.put("ColorlessConversion", "Color")
.build();
public static final ImmutableMap<String, String> ANY_TYPE_CONVERSION = new ImmutableMap.Builder<String, String>()
.putAll(ANY_COLOR_CONVERSION)
.put("ColorlessConversion", "All")
.put("ManaColorConversion", "Additive")
.put("WhiteConversion", "Type")
.put("BlueConversion", "Type")
.put("BlackConversion", "Type")
.put("RedConversion", "Type")
.put("GreenConversion", "Type")
.put("ColorlessConversion", "Type")
.build();
/**
* Private constructor to prevent instantiation.

View File

@@ -1802,9 +1802,12 @@ public class AbilityUtils {
if (params.containsKey(key)) {
String convertTo = params.get(key);
byte convertByte = 0;
if ("All".equals(convertTo)) {
if ("Type".equals(convertTo)) {
// IMPORTANT! We need to use Mana Color here not Card Color.
convertByte = ManaAtom.ALL_MANA_TYPES;
} else if ("Color".equals(convertTo)) {
// IMPORTANT! We need to use Mana Color here not Card Color.
convertByte = ManaAtom.ALL_MANA_COLORS;
} else {
for (final String convertColor : convertTo.split(",")) {
convertByte |= ManaAtom.fromName(convertColor);