package com.minelittlepony.unicopia; import java.util.function.Predicate; import com.minelittlepony.unicopia.entity.Equine; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; public interface EquinePredicates { Predicate IS_PLAYER = e -> e instanceof PlayerEntity; Predicate RACE_INTERACT_WITH_CLOUDS = entity -> Equine.of(entity).getSpecies().canInteractWithClouds(); Predicate PLAYER_UNICORN = IS_PLAYER.and(entity -> Equine.of(entity).getSpecies().canCast()); Predicate PLAYER_CHANGELING = IS_PLAYER.and(entity -> Equine.of(entity).getSpecies() == Race.CHANGELING); Predicate PLAYER_PEGASUS = IS_PLAYER.and(entity -> ((PlayerEntity)entity).abilities.creativeMode || RACE_INTERACT_WITH_CLOUDS.test(entity)); }