fixed allied players being hit by soulstrider armor effect

closes #334
This commit is contained in:
Ell 2023-11-11 16:10:46 +01:00
parent 791c6ada5e
commit d7e4389344

View file

@ -81,7 +81,7 @@ public class ItemArmor extends ArmorItem implements IModItem {
((LivingEntity) source).addEffect(new MobEffectInstance(MobEffects.WITHER, 40));
} else if (ItemArmor.isFullSetEquipped(entity, ModArmorMaterial.DEPTH)) {
for (var other : entity.level().getEntitiesOfClass(LivingEntity.class, new AABB(entity.position(), Vec3.ZERO).inflate(2))) {
if (other != entity && (!(other instanceof Player otherPlayer) || !otherPlayer.isAlliedTo(entity)))
if (other != entity && (!(entity instanceof Player player) || !player.isAlliedTo(other)))
other.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 60, 255));
}
}