From 084476b8b02183ba3e4977324fff9a144c3593a9 Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Wed, 9 Jun 2021 18:43:34 +0200 Subject: [PATCH] Clean up --- .../src/main/java/forge/game/ability/effects/CharmEffect.java | 1 - .../java/forge/game/ability/effects/CopyPermanentEffect.java | 4 ++-- .../src/main/java/forge/player/PlayerControllerHuman.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/CharmEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CharmEffect.java index 7ec25a53304..48dde355eb9 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CharmEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CharmEffect.java @@ -243,5 +243,4 @@ public class CharmEffect extends SpellAbilityEffect { } - } diff --git a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java index 42cccd4b5be..e6abc6b6fcd 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java @@ -99,9 +99,9 @@ public class CopyPermanentEffect extends TokenEffectBase { if (sa.hasParam("RandomCopied")) { List copysource = Lists.newArrayList(cards); List choice = Lists.newArrayList(); - final String num = sa.hasParam("RandomNum") ? sa.getParam("RandomNum") : "1"; + final String num = sa.getParamOrDefault("RandomNum","1"); int ncopied = AbilityUtils.calculateAmount(host, num, sa); - while(ncopied > 0 && !copysource.isEmpty()) { + while (ncopied > 0 && !copysource.isEmpty()) { final PaperCard cp = Aggregates.random(copysource); Card possibleCard = Card.fromPaperCard(cp, activator); // Need to temporarily set the Owner so the Game is set diff --git a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java index e0f5d2ee606..2eea93c1e7b 100644 --- a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java @@ -487,7 +487,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont private boolean useSelectCardsInput(final FCollectionView sourceList) { // can't use InputSelect from GUI thread (e.g., DevMode Tutor) - if ( FThreads.isGuiThread() ) { return false; } + if (FThreads.isGuiThread()) { return false; } // if UI_SELECT_FROM_CARD_DISPLAYS not set use InputSelect only for battlefield and player hand // if UI_SELECT_FROM_CARD_DISPLAYS set and using desktop GUI use InputSelect for any zone that can be shown