mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Merge pull request #2891 from kubikrubikvkube/master
Nulls to optional. Also there was bug with AetherChaser
This commit is contained in:
commit
afbf5ce2b6
131 changed files with 188 additions and 183 deletions
|
|
@ -27,11 +27,6 @@
|
|||
*/
|
||||
package mage.abilities.costs.mana;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.Cost;
|
||||
|
|
@ -45,13 +40,15 @@ import mage.players.Player;
|
|||
import mage.target.Targets;
|
||||
import mage.util.ManaUtil;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @param <T>
|
||||
*/
|
||||
public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements ManaCosts<T> {
|
||||
|
||||
protected UUID id;
|
||||
protected final UUID id;
|
||||
protected String text = null;
|
||||
|
||||
private static Map<String, ManaCosts> costs = new HashMap<>();
|
||||
|
|
@ -323,7 +320,7 @@ public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements M
|
|||
if (mana == null || mana.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String[] symbols = mana.split("^\\{|\\}\\{|\\}$");
|
||||
String[] symbols = mana.split("^\\{|}\\{|}$");
|
||||
int modifierForX = 0;
|
||||
for (String symbol : symbols) {
|
||||
if (!symbol.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import java.util.Objects;
|
|||
*/
|
||||
public class EpicEffect extends OneShotEffect {
|
||||
|
||||
final String rule = "<br>Epic <i>(For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps for the rest of the game, copy this spell except for its epic ability. If the spell has targets, you may choose new targets for the copy)";
|
||||
static final String rule = "<br>Epic <i>(For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps for the rest of the game, copy this spell except for its epic ability. If the spell has targets, you may choose new targets for the copy)";
|
||||
|
||||
public EpicEffect() {
|
||||
super(Outcome.Benefit);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ package mage.actions.score;
|
|||
*
|
||||
* @author ayratn
|
||||
*/
|
||||
public class ScoringConstants {
|
||||
public final class ScoringConstants {
|
||||
public static final int WIN_GAME_SCORE = 100000000;
|
||||
public static final int LOSE_GAME_SCORE = -WIN_GAME_SCORE;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.cards.decks.DeckCardLists;
|
|||
*
|
||||
* @author North
|
||||
*/
|
||||
public class DeckImporterUtil {
|
||||
public final class DeckImporterUtil {
|
||||
|
||||
public static DeckImporter getDeckImporter(String file) {
|
||||
if (file.toLowerCase().endsWith("dec")) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author North
|
||||
*/
|
||||
public class CardScanner {
|
||||
public final class CardScanner {
|
||||
|
||||
public static boolean scanned = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import java.util.List;
|
|||
*
|
||||
* @author Lymia
|
||||
*/
|
||||
public class PluginClassloaderRegistery {
|
||||
public final class PluginClassloaderRegistery {
|
||||
static List<ClassLoader> pluginClassloaders = new ArrayList<>();
|
||||
|
||||
public static void registerPluginClassloader(ClassLoader cl) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
*
|
||||
* @author North
|
||||
*/
|
||||
public class RepositoryUtil {
|
||||
public final class RepositoryUtil {
|
||||
|
||||
public static boolean isDatabaseObsolete(ConnectionSource connectionSource, String entityName, long version) throws SQLException {
|
||||
TableUtils.createTableIfNotExists(connectionSource, DatabaseVersion.class);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class StaticFilters {
|
||||
public final class StaticFilters {
|
||||
|
||||
public static final FilterCreaturePermanent FILTER_ARTIFACT_CREATURE_PERMANENT = new FilterArtifactCreaturePermanent();
|
||||
public static final FilterPermanent FILTER_PERMANENT_ARTIFACT_OR_CREATURE = new FilterPermanent("artifact or creature");
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import mage.target.TargetCard;
|
|||
/**
|
||||
* Created by samuelsandeen on 9/6/16.
|
||||
*/
|
||||
public class ZonesHandler {
|
||||
public final class ZonesHandler {
|
||||
|
||||
public static boolean cast(ZoneChangeInfo info, Game game) {
|
||||
if (maybeRemoveFromSourceZone(info, game)) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public abstract class DraftCube {
|
|||
private static final Logger logger = Logger.getLogger(DraftCube.class);
|
||||
|
||||
private final String name;
|
||||
private final int boosterSize = 15;
|
||||
private static final int boosterSize = 15;
|
||||
|
||||
protected List<CardIdentity> cubeCards = new ArrayList<>();
|
||||
protected List<CardIdentity> leftCubeCards = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ import mage.util.functions.CopyTokenFunction;
|
|||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
public class CardUtil {
|
||||
public final class CardUtil {
|
||||
|
||||
private static final String regexBlack = ".*\\x7b.{0,2}B.{0,2}\\x7d.*";
|
||||
private static final String regexBlue = ".*\\x7b.{0,2}U.{0,2}\\x7d.*";
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import java.util.jar.JarInputStream;
|
|||
*
|
||||
* @author North
|
||||
*/
|
||||
public class ClassScanner {
|
||||
public final class ClassScanner {
|
||||
|
||||
private static void checkClassForInclusion(List<Class> cards, Class type, String name, ClassLoader cl) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import java.util.Date;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DateFormat {
|
||||
public final class DateFormat {
|
||||
|
||||
/**
|
||||
* calculates the duration between two dates and returns a string in the format hhh:mm:ss
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ package mage.util;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DeckUtil {
|
||||
public final class DeckUtil {
|
||||
|
||||
public static long fixedHash(String string) {
|
||||
long h = 1125899906842597L; // prime
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.ObjectColor;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class GameLog {
|
||||
public final class GameLog {
|
||||
|
||||
static final String LOG_COLOR_PLAYER = "#20B2AA"; // LightSeaGreen
|
||||
static final String LOG_COLOR_PLAYER_REQUEST = "#D2691E"; // Chocolate
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import mage.game.Game;
|
|||
/**
|
||||
* @author noxx
|
||||
*/
|
||||
public class ManaUtil {
|
||||
public final class ManaUtil {
|
||||
|
||||
private ManaUtil() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import java.util.concurrent.ThreadLocalRandom;
|
|||
/**
|
||||
* Created by IGOUDT on 5-9-2016.
|
||||
*/
|
||||
public class RandomUtil {
|
||||
public final class RandomUtil {
|
||||
|
||||
|
||||
public static Random getRandom() {return ThreadLocalRandom.current();}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import mage.constants.Rarity;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TournamentUtil {
|
||||
public final class TournamentUtil {
|
||||
|
||||
/**
|
||||
* Tries to calculate the most appropiate sets to add basic lands for cards of a deck
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import mage.constants.CardType;
|
|||
/**
|
||||
* @author magenoxx_at_gmail.com
|
||||
*/
|
||||
public class TraceUtil {
|
||||
public final class TraceUtil {
|
||||
|
||||
private static final Logger log = Logger.getLogger(TraceUtil.class);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue