removed unnecessary lastAddedToken method from TokenImpl, reworked Warren Weirding

This commit is contained in:
Evan Kranzler 2022-03-31 20:12:09 -04:00
parent 676c3a8bb4
commit a581d55160
7 changed files with 31 additions and 69 deletions

View file

@ -6,7 +6,6 @@ import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
/**
*
* @author weirddan455
*/
public class CreateTokenAttachSourceEffect extends CreateTokenEffect {
@ -28,7 +27,7 @@ public class CreateTokenAttachSourceEffect extends CreateTokenEffect {
@Override
public boolean apply(Game game, Ability source) {
super.apply(game, source);
Permanent token = game.getPermanent(this.getLastAddedTokenId());
Permanent token = game.getPermanent(this.getLastAddedTokenIds().stream().findFirst().orElse(null));
if (token != null) {
token.addAttachment(source.getSourceId(), source, game);
return true;