diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-02-02 00:01:33 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-02-02 00:28:41 +0100 |
commit | cbe32fca80ab02b6efcf48af5588827fbb3a2f47 (patch) | |
tree | 1ae990da9f5533e20553cda8c6f190b056be3b64 /src | |
parent | 27b75075d651a48f31f20114d678cbc3c8d791e1 (diff) | |
download | bukkit-cbe32fca80ab02b6efcf48af5588827fbb3a2f47.tar bukkit-cbe32fca80ab02b6efcf48af5588827fbb3a2f47.tar.gz bukkit-cbe32fca80ab02b6efcf48af5588827fbb3a2f47.tar.lz bukkit-cbe32fca80ab02b6efcf48af5588827fbb3a2f47.tar.xz bukkit-cbe32fca80ab02b6efcf48af5588827fbb3a2f47.zip |
Add Chunk.getBlock(x,y,z), World.loadChunk(x,z) World.isChunkLoaded(x,z).
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/Chunk.java | 12 | ||||
-rw-r--r-- | src/main/java/org/bukkit/World.java | 19 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java index 3f158f5b..539ecb84 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -1,6 +1,8 @@ package org.bukkit; +import org.bukkit.block.Block; + /** * Represents a chunk of blocks */ @@ -26,4 +28,14 @@ public interface Chunk { * @return Parent World */ World getWorld(); + + /** + * Gets a block from this chunk + * + * @param x 0-15 + * @param y 0-127 + * @param z 0-15 + * @return the Block + */ + Block getBlock(int x, int y, int z); } diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 93b1a719..f3f66443 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -80,7 +80,24 @@ public interface World { * */ public void loadChunk(Chunk chunk); - + + /** + * Checks if the chunk at the specified coordinates is loaded + * + * @param x X-coordinate of the chunk + * @param z Z-coordinate of the chunk + * @return true if the chunk is loaded, otherwise false + */ + public boolean isChunkLoaded(int x, int z); + + /** + * Loads the chunk at the specified coordinates + * @param x X-coordinate of the chunk + * @param z Z-coordinate of the chunk + * + */ + public void loadChunk(int x, int z); + /** * Drop an item exactly at the specified location. * |