Fixed shields not deflecting projectiles

This commit is contained in:
Sollace 2024-02-27 21:20:33 +00:00
parent 9c71272def
commit e03fb016d5
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -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.projectile.ProjectileEntity;
import net.minecraft.entity.vehicle.BoatEntity;
import net.minecraft.predicate.entity.EntityPredicates;
@ -34,7 +35,11 @@ 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) && !(e instanceof BoatEntity);
Predicate<Entity> IS_MAGIC_IMMUNE = e -> (e instanceof MagicImmune || !(e instanceof LivingEntity))
&& !(e instanceof ItemEntity)
&& !(e instanceof ExperienceOrbEntity)
&& !(e instanceof BoatEntity)
&& !(e instanceof ProjectileEntity);
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);