Skip to content

Commit

Permalink
Fix Vengeance Spirits always attacking, even when not visible. Fix #263
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Sep 18, 2015
1 parent 00fa0d5 commit 199b0c1
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.cyclops.evilcraft.core.monster.EntityNoMob;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.*;
Expand Down Expand Up @@ -37,6 +36,7 @@
import org.cyclops.evilcraft.client.particle.EntityDarkSmokeFX;
import org.cyclops.evilcraft.client.particle.EntityDegradeFX;
import org.cyclops.evilcraft.core.helper.obfuscation.ObfuscationHelpers;
import org.cyclops.evilcraft.core.monster.EntityNoMob;
import org.cyclops.evilcraft.item.BurningGemStone;
import org.cyclops.evilcraft.item.BurningGemStoneConfig;

Expand Down Expand Up @@ -116,7 +116,7 @@ public VengeanceSpirit(World world) {
this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityPlayer.class, damage, false));

this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, false, false));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true, false));

setRemainingLife(remainingLife);
setFrozenDuration(0);
Expand Down Expand Up @@ -341,7 +341,7 @@ private void spawnSwarmParticles() {
* @return If it is visible
*/
public boolean isVisible() {
return worldObj.isRemote &&
return worldObj.isRemote &&
(isAlternativelyVisible() || isClientVisible());
}

Expand Down Expand Up @@ -384,7 +384,7 @@ public boolean canEntityBeSeen(Entity entity) {
* @return If it should be visible.
*/
public boolean isEnabledVengeance(EntityPlayer player) {
return isGlobalVengeance() || ArrayUtils.contains(getVengeancePlayers(), player.getDisplayName());
return isGlobalVengeance() || ArrayUtils.contains(getVengeancePlayers(), player.getDisplayName().getFormattedText());
}

/**
Expand All @@ -394,7 +394,7 @@ public boolean isEnabledVengeance(EntityPlayer player) {
*/
public void setEnabledVengeance(EntityPlayer player, boolean enabled) {
String[] players = getVengeancePlayers();
int index = ArrayUtils.indexOf(players, player.getDisplayName());
int index = ArrayUtils.indexOf(players, player.getDisplayName().getFormattedText());
if(enabled && index == ArrayUtils.INDEX_NOT_FOUND)
players = ArrayUtils.add(players, player.getDisplayName().getFormattedText());
else if(!enabled && index != ArrayUtils.INDEX_NOT_FOUND)
Expand Down

0 comments on commit 199b0c1

Please sign in to comment.