diff --git a/src/main/java/org/bukkit/craftbukkit/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/CraftBlock.java
index 19dce3c70e..4048434a38 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftBlock.java
@@ -156,6 +156,26 @@ public class CraftBlock implements Block {
return getRelative(face.getModX(), face.getModY(), face.getModZ());
}
+ /**
+ * Gets the block at the given distance of the given face
+ *
+ * For example, the following method places water at 100,102,100; two blocks
+ * above 100,100,100.
+ *
+ * Block block = world.getBlockAt(100,100,100); + * Block shower = block.getFace(BlockFace.Up, 2); + * shower.setType(Material.WATER); + *+ * + * @param face Face of this block to return + * @param distance Distance to get the block at + * @return Block at the given face + */ + public Block getFace(final BlockFace face, final int distance) { + return getRelative(face.getModX() * distance, face.getModY() * distance, + face.getModZ() * distance); + } + /** * Gets the block at the given offsets * @@ -168,6 +188,38 @@ public class CraftBlock implements Block { return getWorld().getBlockAt(getX() + modX, getY() + modY, getZ() + modZ); } + /** + * Gets the face relation of this block compared to the given block
+ * Block current = world.getBlockAt(100, 100, 100); + * Block target = world.getBlockAt(100, 101, 100); + * + * current.getFace(target) == BlockFace.Up; + *+ *