mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed chilling breath spell
This commit is contained in:
parent
58561a5eea
commit
850aa8a9fd
2 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@ import com.minelittlepony.unicopia.item.enchantment.WantItNeedItEnchantment;
|
|||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.decoration.AbstractDecorationEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.vehicle.BoatEntity;
|
||||
import net.minecraft.predicate.entity.EntityPredicates;
|
||||
|
||||
public interface EquinePredicates {
|
||||
|
@ -33,7 +34,7 @@ public interface EquinePredicates {
|
|||
Predicate<Entity> IS_CASTER = e -> !e.isRemoved() && (e instanceof Caster || IS_PLAYER.test(e));
|
||||
Predicate<Entity> IS_PLACED_SPELL = e -> e instanceof Caster && !e.isRemoved();
|
||||
|
||||
Predicate<Entity> IS_MAGIC_IMMUNE = e -> (e instanceof MagicImmune || !(e instanceof LivingEntity)) && !(e instanceof ItemEntity) && !(e instanceof ExperienceOrbEntity);
|
||||
Predicate<Entity> IS_MAGIC_IMMUNE = e -> (e instanceof MagicImmune || !(e instanceof LivingEntity)) && !(e instanceof ItemEntity) && !(e instanceof ExperienceOrbEntity) && !(e instanceof BoatEntity);
|
||||
Predicate<Entity> EXCEPT_MAGIC_IMMUNE = IS_MAGIC_IMMUNE.negate();
|
||||
Predicate<Entity> VALID_LIVING_AND_NOT_MAGIC_IMMUNE = EntityPredicates.VALID_LIVING_ENTITY.and(EXCEPT_MAGIC_IMMUNE);
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ public class UnicornCastingAbility extends AbstractSpellCastingAbility {
|
|||
} else {
|
||||
player.setAnimation(Animation.ARMS_UP, Animation.Recipient.HUMAN);
|
||||
if (s instanceof HomingSpell homer) {
|
||||
TraceHelper.findEntity(player.asEntity(), homer.getRange(player), 1, EquinePredicates.VALID_LIVING_AND_NOT_MAGIC_IMMUNE).ifPresent(homer::setTarget);
|
||||
TraceHelper.findEntity(player.asEntity(), homer.getRange(player), 1, EquinePredicates.EXCEPT_MAGIC_IMMUNE).ifPresent(homer::setTarget);
|
||||
}
|
||||
player.playSound(USounds.SPELL_CAST_SUCCESS, 0.05F, 2.2F);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue