mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-08 06:26:43 +01:00
Fix time change ability not appearing for unicorns wearing the unicorn amulet
This commit is contained in:
parent
82ec2b4f14
commit
8385232c5b
3 changed files with 5 additions and 4 deletions
|
@ -186,13 +186,13 @@ public record Race (boolean canCast, FlightType flightType, boolean canUseEarth,
|
|||
return REGISTRY.stream().filter(r -> r.isPermitted(player)).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public record Composite (Race physical, Race pseudo) {
|
||||
public record Composite (Race physical, @Nullable Race pseudo) {
|
||||
public boolean includes(Race race) {
|
||||
return physical == race || pseudo == race;
|
||||
}
|
||||
|
||||
public boolean any(Predicate<Race> test) {
|
||||
return test.test(physical) || test.test(pseudo);
|
||||
return test.test(physical) || (pseudo != null && test.test(pseudo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public class TimeChangeAbility implements Ability<Hit> {
|
|||
|
||||
@Override
|
||||
public boolean canUse(Race.Composite race) {
|
||||
return race.physical() != race.pseudo() && race.pseudo() == Race.UNICORN;
|
||||
return race.pseudo() == Race.UNICORN;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -229,7 +229,8 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
|
|||
return new Race.Composite(observed,
|
||||
AmuletSelectors.UNICORN_AMULET.test(entity) ? Race.UNICORN
|
||||
: AmuletSelectors.ALICORN_AMULET.test(entity) ? Race.ALICORN
|
||||
: observed);
|
||||
: null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue