summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-01-04 14:17:05 +0000
committerDinnerbone <dinnerbone@dinnerbone.com>2011-01-04 14:17:05 +0000
commita2c944d3c0409568109dfb9ceb1f47f896bf29fd (patch)
treef6a10f6e31777ee141a6ac786e7e5f8b8f043be5 /src/main/java/org/bukkit
parent8680ee387fb428cef246b2d04702b9a3839630ef (diff)
downloadcraftbukkit-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.java14
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftWorld.java2
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);
}