From 3f78497fde915ea04a1e73545c2466c85add69fa Mon Sep 17 00:00:00 2001 From: asofold Date: Sun, 16 Feb 2014 19:25:12 +0100 Subject: [PATCH] Add manhattan method for having one block. --- .../neatmonster/nocheatplus/utilities/TrigUtil.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TrigUtil.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TrigUtil.java index 349960db..2e573170 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TrigUtil.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TrigUtil.java @@ -382,6 +382,18 @@ public class TrigUtil { return yawDiff; } + /** + * Manhattan distance. + * @param x1 + * @param y1 + * @param z1 + * @param block + * @return + */ + public static int manhattan(final int x1, final int y1, final int z1, final Block block) { + return manhattan(x1, y1, z1, block.getX(), block.getY(), block.getZ()); + } + /** * Manhattan distance (steps along the sides of an orthogonal grid). * @param x1