summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-02-18 16:34:49 +0000
committerDinnerbone <dinnerbone@dinnerbone.com>2011-02-18 16:34:49 +0000
commit31f67329ce2f959ba8c0fc9b5b0038a819c6b704 (patch)
tree00ff624f399a27dfcc4e6c50ff9d90c5530dfabc /src
parent1e94bb16f5104b3a3c7fab5b83b98e3e248b7fe9 (diff)
downloadbukkit-31f67329ce2f959ba8c0fc9b5b0038a819c6b704.tar
bukkit-31f67329ce2f959ba8c0fc9b5b0038a819c6b704.tar.gz
bukkit-31f67329ce2f959ba8c0fc9b5b0038a819c6b704.tar.lz
bukkit-31f67329ce2f959ba8c0fc9b5b0038a819c6b704.tar.xz
bukkit-31f67329ce2f959ba8c0fc9b5b0038a819c6b704.zip
Added a whole buncha overloads for Location in World
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/Location.java2
-rw-r--r--src/main/java/org/bukkit/World.java33
2 files changed, 34 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 85f2c714..95b9557a 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -52,7 +52,7 @@ public class Location implements Cloneable {
* @return Block at the represented location
*/
public Block getBlock() {
- return world.getBlockAt(getBlockX(), getBlockY(), getBlockZ());
+ return world.getBlockAt(this);
}
/**
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index df8c7e2a..77ef9099 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -34,6 +34,16 @@ public interface World {
* @return Block at the given location
*/
public Block getBlockAt(int x, int y, int z);
+
+ /**
+ * Gets the block at the given location
+ *
+ * This block will always represent the latest state
+ *
+ * @param location Location of the block
+ * @return Block at the given location
+ */
+ public Block getBlockAt(Location location);
/**
* Gets the block type-id at the given location
@@ -46,6 +56,14 @@ public interface World {
public int getBlockTypeIdAt(int x, int y, int z);
/**
+ * Gets the block type-id at the given location
+ *
+ * @param location Location of the block
+ * @return TypeId of the block at the given location
+ */
+ public int getBlockTypeIdAt(Location location);
+
+ /**
* Gets the highest non-air coordinate at the given (x,z) location
* @param x X-coordinate of the blocks
* @param z Z-coordinate of the blocks
@@ -54,6 +72,13 @@ public interface World {
public int getHighestBlockYAt(int x, int z);
/**
+ * Gets the highest non-air coordinate at the given location
+ * @param location Location of the blocks
+ * @return Y-coordinate of the highest non-air block
+ */
+ public int getHighestBlockYAt(Location location);
+
+ /**
* Gets the chunk at the given location
*
* @param x X-coordinate of the chunk
@@ -63,6 +88,14 @@ public interface World {
public Chunk getChunkAt(int x, int z);
/**
+ * Gets the chunk at the given location
+ *
+ * @param location Location of the chunk
+ * @return Chunk at the given location
+ */
+ public Chunk getChunkAt(Location location);
+
+ /**
* Gets the chunk which contains the given block
*
* @param block Block to get the parent chunk from