Skip to content
Permalink
Browse files

fix previous commit

  • Loading branch information...
mcmonkey4eva committed Jan 25, 2019
1 parent 5fb1cb9 commit 6f813f7bedeb03d55c72ebe587e12398c6ddec1a
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/org/mcmonkey/sentinel/targeting/SentinelTargetingHelper.java
@@ -183,7 +183,7 @@ public boolean isTargeted(LivingEntity entity) {
if (sentinel.getGuarding() != null && entity.getUniqueId().equals(sentinel.getGuarding())) {
return false;
}
if (!isTargetable(entity)) {
if (isUntargetable(entity)) {
return false;
}
tempTarget.targetID = entity.getUniqueId();
@@ -420,9 +420,9 @@ public void updateAvoids() {
}

/**
* Returns whether an entity is even able to be targeted.
* Returns whether an entity is not able to be targeted at all.
*/
public static boolean isTargetable(Entity e) {
public static boolean isUntargetable(Entity e) {
return e == null ||
(e instanceof Player && (((Player) e).getGameMode() == GameMode.CREATIVE || ((Player) e).getGameMode() == GameMode.SPECTATOR)) ||
e.isDead();
@@ -434,7 +434,7 @@ public static boolean isTargetable(Entity e) {
public void updateTargets() {
for (SentinelCurrentTarget uuid : new HashSet<>(currentTargets)) {
Entity e = SentinelUtilities.getEntityForID(uuid.targetID);
if (!isTargetable(e)) {
if (isUntargetable(e)) {
currentTargets.remove(uuid);
continue;
}

0 comments on commit 6f813f7

Please sign in to comment.
You can’t perform that action at this time.