コード例 #1
0
 @Override
 protected boolean canContinueAction() {
   return !NativeInterfaces.NAVIGATION.METHOD_ISNOTMOVING.invoke(
           this.mob.nmsEntity.getNavigation())
       && (NativeInterfaces.ENTITY.METHOD_GETDISTANCETOENTITYSQUARED.invoke(
               this.mob.nmsEntity, this.action.target)
           > this.action.minimumDistanceSquared);
 }
コード例 #2
0
 @Override
 protected boolean canStartAction() {
   this.mob.adjustMaximumNavigationDistance(
       (float)
           Math.sqrt(
               NativeInterfaces.ENTITY.METHOD_GETDISTANCETOENTITYSQUARED.invoke(
                   this.mob.nmsEntity, action.target)));
   final PathEntity path =
       NativeInterfaces.NAVIGATION.METHOD_CREATEPATHTOENTITY.invoke(
           this.mob.nmsEntity.getNavigation(), this.action.target);
   if (path == null) return false;
   this.path = path;
   return true;
 }
コード例 #3
0
 @Override
 protected boolean isActionRequired() {
   return NativeInterfaces.ENTITY.METHOD_GETDISTANCETOENTITYSQUARED.invoke(
           this.mob.nmsEntity, action.target)
       > action.maximumDistanceSquared;
 }