Esempio n. 1
0
 public static boolean hitBox(
     Location paramLocation, org.bukkit.entity.Entity paramEntity, double paramDouble) {
   if (UtilMath.offset(paramLocation, paramEntity.getLocation().add(0.0D, 0.4D, 0.0D))
       < 0.6D * paramDouble) {
     return true;
   }
   if ((paramEntity instanceof Player)) {
     Player localPlayer = (Player) paramEntity;
     if (UtilMath.offset(paramLocation, localPlayer.getEyeLocation()) < 0.4D * paramDouble) {
       return true;
     }
     if (UtilMath.offset2d(paramLocation, localPlayer.getLocation()) < 0.6D * paramDouble) {
       if ((paramLocation.getY() > localPlayer.getLocation().getY())
           && (paramLocation.getY() < localPlayer.getEyeLocation().getY())) {
         return true;
       }
     }
   } else if ((paramEntity instanceof Giant)) {
     if ((paramLocation.getY() > paramEntity.getLocation().getY())
         && (paramLocation.getY() < paramEntity.getLocation().getY() + 12.0D)
         && (UtilMath.offset2d(paramLocation, paramEntity.getLocation()) < 4.0D)) {
       return true;
     }
   } else if ((paramLocation.getY() > paramEntity.getLocation().getY())
       && (paramLocation.getY() < paramEntity.getLocation().getY() + 2.0D)
       && (UtilMath.offset2d(paramLocation, paramEntity.getLocation()) < 0.5D * paramDouble)) {
     return true;
   }
   return false;
 }
Esempio n. 2
0
  public static boolean CreatureMoveFast(
      org.bukkit.entity.Entity paramEntity, Location paramLocation, float paramFloat) {
    if (!(paramEntity instanceof Creature)) {
      return false;
    }
    if (UtilMath.offset(paramEntity.getLocation(), paramLocation) < 0.1D) {
      return false;
    }
    if (UtilMath.offset(paramEntity.getLocation(), paramLocation) < 2.0D) {
      paramFloat = Math.min(paramFloat, 1.0F);
    }
    EntityCreature localEntityCreature = ((CraftCreature) paramEntity).getHandle();
    localEntityCreature
        .getControllerMove()
        .a(paramLocation.getX(), paramLocation.getY(), paramLocation.getZ(), paramFloat);

    return true;
  }
Esempio n. 3
0
  public static void CreatureMove(
      org.bukkit.entity.Entity paramEntity, Location paramLocation, float paramFloat) {
    if (!(paramEntity instanceof Creature)) {
      return;
    }
    if (UtilMath.offset(paramEntity.getLocation(), paramLocation) < 0.1D) {
      return;
    }
    EntityCreature localEntityCreature = ((CraftCreature) paramEntity).getHandle();
    NavigationAbstract localNavigationAbstract = localEntityCreature.getNavigation();
    if (UtilMath.offset(paramEntity.getLocation(), paramLocation) > 24.0D) {
      Location localLocation = paramEntity.getLocation();

      localLocation.add(
          UtilAlg.getTrajectory(paramEntity.getLocation(), paramLocation).multiply(24));

      localNavigationAbstract.a(
          localLocation.getX(), localLocation.getY(), localLocation.getZ(), paramFloat);
    } else {
      localNavigationAbstract.a(
          paramLocation.getX(), paramLocation.getY(), paramLocation.getZ(), paramFloat);
    }
  }