コード例 #1
0
 @ScriptCallable(
     returnTypes = {ReturnType.NUMBER, ReturnType.NUMBER, ReturnType.NUMBER},
     description = "Get turtle position")
 public IMultiReturn getPosition() {
   EntityMagnet magnet = getMagnet();
   Vec3 rotated = getRelativeDistance(magnet);
   return MultiReturn.wrap(rotated.xCoord, rotated.yCoord, rotated.zCoord);
 }
コード例 #2
0
 @Alias("distance")
 @ScriptCallable(returnTypes = {ReturnType.NUMBER, ReturnType.NUMBER, ReturnType.NUMBER})
 public IMultiReturn getDistanceToTarget() {
   EntityMagnet magnet = getMagnet();
   Vec3 current = getRelativeDistance(magnet);
   Vec3 target = magnetOwner.target;
   return MultiReturn.wrap(
       current.xCoord - target.xCoord,
       current.yCoord - target.yCoord,
       current.zCoord - target.zCoord);
 }