From 1e94bb16f5104b3a3c7fab5b83b98e3e248b7fe9 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Fri, 18 Feb 2011 16:28:42 +0000 Subject: [PATCH] Location.getBlock() helper method --- src/main/java/org/bukkit/Location.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java index 7316ea33..85f2c714 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -1,6 +1,7 @@ package org.bukkit; +import org.bukkit.block.Block; import org.bukkit.util.Vector; /** @@ -45,6 +46,15 @@ public class Location implements Cloneable { return world; } + /** + * Gets the block at the represented location + * + * @return Block at the represented location + */ + public Block getBlock() { + return world.getBlockAt(getBlockX(), getBlockY(), getBlockZ()); + } + /** * Sets the x-coordinate of this location *