mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Prevent sombra from targetting things it shouldn't
This commit is contained in:
parent
48f9d6242c
commit
8f2cd29488
1 changed files with 4 additions and 1 deletions
|
@ -7,6 +7,7 @@ import java.util.stream.Stream;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.minelittlepony.unicopia.EquinePredicates;
|
||||||
import com.minelittlepony.unicopia.USounds;
|
import com.minelittlepony.unicopia.USounds;
|
||||||
import com.minelittlepony.unicopia.ability.magic.spell.AbstractDisguiseSpell;
|
import com.minelittlepony.unicopia.ability.magic.spell.AbstractDisguiseSpell;
|
||||||
import com.minelittlepony.unicopia.advancement.UCriteria;
|
import com.minelittlepony.unicopia.advancement.UCriteria;
|
||||||
|
@ -579,7 +580,9 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canTarget(LivingEntity target) {
|
public boolean canTarget(LivingEntity target) {
|
||||||
if (target instanceof PlayerEntity player && (player.isCreative() || player.isSpectator())) {
|
if (target instanceof SombraEntity
|
||||||
|
|| EquinePredicates.IS_MAGIC_IMMUNE.test(target)
|
||||||
|
|| !EntityPredicates.EXCEPT_CREATIVE_OR_SPECTATOR.test(target)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue