Skip to content

Commit

Permalink
Prevent wolves getting angry if a nearby non-NPC wolf is damaged
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jul 31, 2016
1 parent e406c78 commit c9d2f0c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftWolf;
import org.bukkit.entity.Wolf;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.util.Vector;

import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
Expand All @@ -15,6 +16,7 @@
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityLiving;
import net.minecraft.server.v1_10_R1.EntityWolf;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
Expand Down Expand Up @@ -192,6 +194,10 @@ public boolean m_() {
}
}

@Override
public boolean setGoalTarget(EntityLiving entityliving, EntityTargetEvent.TargetReason reason, boolean fire) {
return npc == null ? super.setGoalTarget(killer, reason, fire) : false;
}
}

public static class WolfNPC extends CraftWolf implements NPCHolder {
Expand Down

0 comments on commit c9d2f0c

Please sign in to comment.