Skip to content
Permalink
Browse files

Add some bunny handler code, for #58

  • Loading branch information...
mcmonkey4eva committed Aug 1, 2016
1 parent a9bef6f commit 42e7f34ca2b1bf43a75024618151fbfdcbdc45af
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/main/java/org/mcmonkey/sentinel/SentinelTrait.java
@@ -619,16 +619,22 @@ public void punch(LivingEntity entity) {
}
}

Location bunny_goal = new Location(null, 0, 0, 0);

public void chase(LivingEntity entity) {
if (npc.getNavigator().getTargetType() == TargetType.LOCATION
&& npc.getNavigator().getTargetAsLocation() != null
&& npc.getNavigator().getTargetAsLocation().getWorld().equals(entity.getWorld())
&& npc.getNavigator().getTargetAsLocation().distanceSquared(entity.getLocation()) < 2 * 2) {
&& ((npc.getNavigator().getTargetAsLocation().getWorld().equals(entity.getWorld())
&& npc.getNavigator().getTargetAsLocation().distanceSquared(entity.getLocation()) < 2 * 2)
|| (npc.getNavigator().getTargetAsLocation().getWorld().equals(bunny_goal.getWorld())
&& npc.getNavigator().getTargetAsLocation().distanceSquared(bunny_goal) < 2 * 2))) {
return;
}
chasing = entity;
npc.getNavigator().getDefaultParameters().stuckAction(null);
npc.getNavigator().setTarget(entity.getLocation());
System.out.println(bunny_goal.toString());
bunny_goal = entity.getLocation();
npc.getNavigator().getLocalParameters().speedModifier((float) speed);
}

0 comments on commit 42e7f34

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