diff options
author | Raphfrk <raphfrk@gmail.com> | 2011-02-04 20:11:57 +0000 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-02-05 15:06:02 +0100 |
commit | 101d01ef644c29da1393bdd325a910f7aa5cf097 (patch) | |
tree | 0664a7538fcb0badb5b3616c50208c2f2c8d55dd | |
parent | 73f0347eb0fb6ab1cec08e9d83d524678043ab54 (diff) | |
download | craftbukkit-101d01ef644c29da1393bdd325a910f7aa5cf097.tar craftbukkit-101d01ef644c29da1393bdd325a910f7aa5cf097.tar.gz craftbukkit-101d01ef644c29da1393bdd325a910f7aa5cf097.tar.lz craftbukkit-101d01ef644c29da1393bdd325a910f7aa5cf097.tar.xz craftbukkit-101d01ef644c29da1393bdd325a910f7aa5cf097.zip |
getLoadedChunks method
-rw-r--r-- | src/main/java/net/minecraft/server/ChunkProviderServer.java | 13 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index abf5956a..d0da9745 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -33,6 +33,19 @@ public class ChunkProviderServer implements IChunkProvider { this.c = ichunkprovider; } + // CraftBukkit start + public org.bukkit.Chunk[] getLoadedChunks() { + Object[] chunks = e.values().toArray(); + org.bukkit.Chunk[] craftChunks = new CraftChunk[chunks.length]; + + for(int cnt =0;cnt<chunks.length;cnt++) { + craftChunks[cnt] = ((Chunk)chunks[cnt]).bukkitChunk; + } + + return craftChunks; + } + // CraftBukkit end + public boolean a(int i, int j) { ChunkCoordinates chunkcoordinates = new ChunkCoordinates(i, j); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index dc3945db..6f4e49bc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -59,6 +59,10 @@ public class CraftWorld implements World { return world.A.a( x, z ); } + public Chunk[] getLoadedChunks() { + return world.A.getLoadedChunks(); + } + public void loadChunk(int x, int z) { world.A.d(x, z); } |