Example #1
0
 public void CancelTarget(final Core.CoreType coreType) {
   if ((coreType == CoreNow) || (coreType == Core.CoreType.ANY)) {
     if (CoreNow == Core.CoreType.RANDOM_POSITION) {
       Stop_RM();
       Stop_RS();
       Stop_CG();
       final Location nowloc =
           new Location(Bukkit.getServer().getWorlds().get(0), 0.0, -20.0, 0.0);
       nowloc.setYaw(1.0f);
       nowloc.setPitch(1.0f);
       HerobrineAI.HerobrineNPC.moveTo(nowloc);
       CoreNow = Core.CoreType.ANY;
       HerobrineAI.getPluginCore().getPathManager().setPath(null);
     }
     if (AICore.isTarget) {
       if (CoreNow == Core.CoreType.ATTACK) {
         ((Attack) getCore(Core.CoreType.ATTACK)).StopHandler();
       }
       if (CoreNow == Core.CoreType.HAUNT) {
         ((Haunt) getCore(Core.CoreType.HAUNT)).StopHandler();
       }
       AICore._ticks = 0;
       AICore.isTarget = false;
       HerobrineAI.HerobrineHP = HerobrineAI.HerobrineMaxHP;
       AICore.log.info("[HerobrineAI] Target cancelled.");
       final Location nowloc =
           new Location(Bukkit.getServer().getWorlds().get(0), 0.0, -20.0, 0.0);
       nowloc.setYaw(1.0f);
       nowloc.setPitch(1.0f);
       HerobrineAI.HerobrineNPC.moveTo(nowloc);
       CoreNow = Core.CoreType.ANY;
       Bukkit.getServer()
           .getScheduler()
           .scheduleSyncDelayedTask(
               AICore.plugin,
               new Runnable() {
                 @Override
                 public void run() {
                   AICore.this.FindPlayer();
                 }
               },
               (6 / HerobrineAI.getPluginCore().getConfigDB().ShowRate)
                   * (HerobrineAI.getPluginCore().getConfigDB().ShowInterval * 1L));
     }
   }
 }
Example #2
0
 public void DisappearEffect() {
   final Location ploc = AICore.PlayerTarget.getLocation();
   final Location hbloc1 = HerobrineAI.HerobrineNPC.getBukkitEntity().getLocation();
   hbloc1.setY(hbloc1.getY() + 1.0);
   final Location hbloc2 = HerobrineAI.HerobrineNPC.getBukkitEntity().getLocation();
   hbloc2.setY(hbloc2.getY() + 0.0);
   final Location hbloc3 = HerobrineAI.HerobrineNPC.getBukkitEntity().getLocation();
   hbloc3.setY(hbloc3.getY() + 0.5);
   final Location hbloc4 = HerobrineAI.HerobrineNPC.getBukkitEntity().getLocation();
   hbloc4.setY(hbloc4.getY() + 1.5);
   ploc.getWorld().playEffect(hbloc1, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc2, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc3, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc4, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc1, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc2, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc3, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc4, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc1, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc2, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc3, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc4, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc1, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc2, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc3, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc4, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc1, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc2, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc3, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc4, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc1, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc2, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc3, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc4, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc1, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc2, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc3, Effect.SMOKE, 80);
   ploc.getWorld().playEffect(hbloc4, Effect.SMOKE, 80);
   ploc.setY(-20.0);
   HerobrineAI.HerobrineNPC.moveTo(ploc);
 }