mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-03-03 16:51:28 +01:00
Fixed batponies not having night vision when their pseudo-race has been changed
This commit is contained in:
parent
8a88596c67
commit
4ac34f1d5f
1 changed files with 6 additions and 1 deletions
|
@ -4,6 +4,7 @@ import java.util.function.Predicate;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.ability.magic.Caster;
|
import com.minelittlepony.unicopia.ability.magic.Caster;
|
||||||
import com.minelittlepony.unicopia.entity.Equine;
|
import com.minelittlepony.unicopia.entity.Equine;
|
||||||
|
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||||
import com.minelittlepony.unicopia.item.enchantment.UEnchantments;
|
import com.minelittlepony.unicopia.item.enchantment.UEnchantments;
|
||||||
|
|
||||||
import net.minecraft.enchantment.EnchantmentHelper;
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
@ -18,7 +19,7 @@ public interface EquinePredicates {
|
||||||
Predicate<Entity> RACE_INTERACT_WITH_CLOUDS = raceMatches(Race::canInteractWithClouds);
|
Predicate<Entity> RACE_INTERACT_WITH_CLOUDS = raceMatches(Race::canInteractWithClouds);
|
||||||
|
|
||||||
Predicate<Entity> PLAYER_EARTH = IS_PLAYER.and(ofRace(Race.EARTH));
|
Predicate<Entity> PLAYER_EARTH = IS_PLAYER.and(ofRace(Race.EARTH));
|
||||||
Predicate<Entity> PLAYER_BAT = IS_PLAYER.and(ofRace(Race.BAT));
|
Predicate<Entity> PLAYER_BAT = IS_PLAYER.and(ofRace(Race.BAT)).or(physicalRaceMatches(Race.BAT::equals));
|
||||||
Predicate<Entity> PLAYER_UNICORN = IS_PLAYER.and(raceMatches(Race::canCast));
|
Predicate<Entity> PLAYER_UNICORN = IS_PLAYER.and(raceMatches(Race::canCast));
|
||||||
Predicate<Entity> PLAYER_CHANGELING = IS_PLAYER.and(ofRace(Race.CHANGELING));
|
Predicate<Entity> PLAYER_CHANGELING = IS_PLAYER.and(ofRace(Race.CHANGELING));
|
||||||
Predicate<Entity> PLAYER_PEGASUS = IS_PLAYER.and(e -> ((PlayerEntity)e).getAbilities().creativeMode || RACE_INTERACT_WITH_CLOUDS.test(e));
|
Predicate<Entity> PLAYER_PEGASUS = IS_PLAYER.and(e -> ((PlayerEntity)e).getAbilities().creativeMode || RACE_INTERACT_WITH_CLOUDS.test(e));
|
||||||
|
@ -38,4 +39,8 @@ public interface EquinePredicates {
|
||||||
static Predicate<Entity> raceMatches(Predicate<Race> predicate) {
|
static Predicate<Entity> raceMatches(Predicate<Race> predicate) {
|
||||||
return e -> Equine.of(e).map(Equine::getSpecies).filter(predicate).isPresent();
|
return e -> Equine.of(e).map(Equine::getSpecies).filter(predicate).isPresent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Predicate<Entity> physicalRaceMatches(Predicate<Race> predicate) {
|
||||||
|
return e -> Pony.of(e).map(Pony::getActualSpecies).filter(predicate).isPresent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue