From c62e387879131b450ec6e59901ec92793b3a6add Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 15 Jan 2011 19:33:45 -0800 Subject: [PATCH] Added Block.getRelative(BlockFace). --- .../java/org/bukkit/craftbukkit/block/CraftBlock.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index facc162408..2be9f62e28 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -198,6 +198,16 @@ public class CraftBlock implements Block { return getWorld().getBlockAt(getX() + modX, getY() + modY, getZ() + modZ); } + /** + * Gets the block at the given offsets + * + * @param face face + * @return Block at the given offsets + */ + public Block getRelative(BlockFace face) { + return getRelative(face.getModX(), face.getModY(), face.getModZ()); + } + /** * Gets the face relation of this block compared to the given block
*