diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-04 14:17:05 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-04 14:17:05 +0000 |
commit | a2c944d3c0409568109dfb9ceb1f47f896bf29fd (patch) | |
tree | f6a10f6e31777ee141a6ac786e7e5f8b8f043be5 /src/main/java/org/bukkit | |
parent | 8680ee387fb428cef246b2d04702b9a3839630ef (diff) | |
download | craftbukkit-a2c944d3c0409568109dfb9ceb1f47f896bf29fd.tar craftbukkit-a2c944d3c0409568109dfb9ceb1f47f896bf29fd.tar.gz craftbukkit-a2c944d3c0409568109dfb9ceb1f47f896bf29fd.tar.lz craftbukkit-a2c944d3c0409568109dfb9ceb1f47f896bf29fd.tar.xz craftbukkit-a2c944d3c0409568109dfb9ceb1f47f896bf29fd.zip |
Implemented Chunk.getWorld()
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftChunk.java | 14 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java index 003ee0f4..1d278fc9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -2,17 +2,29 @@ package org.bukkit.craftbukkit; import org.bukkit.Chunk; +import org.bukkit.World; public class CraftChunk implements Chunk { + private final CraftWorld world; private final int x; private final int z; - protected CraftChunk(final int x, final int z) { + protected CraftChunk(final CraftWorld world, final int x, final int z) { + this.world = world; this.x = x; this.z = z; } /** + * Gets the world containing this chunk + * + * @return World + */ + public World getWorld() { + return world; + } + + /** * Gets the X-coordinate of this chunk * * @return X-coordinate diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 31b9d0f0..75dc1b45 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -52,7 +52,7 @@ public class CraftWorld implements World { Chunk chunk = chunkCache.get(loc); if (chunk == null) { - chunk = new CraftChunk(x, z); + chunk = new CraftChunk(this, x, z); chunkCache.put(loc, chunk); } |