13
0
geforkt von Mirrors/Paper

Implemented Chunk.getWorld()

Dieser Commit ist enthalten in:
Dinnerbone 2011-01-04 14:17:05 +00:00
Ursprung 8680ee387f
Commit a2c944d3c0
2 geänderte Dateien mit 14 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -2,16 +2,28 @@
package org.bukkit.craftbukkit; package org.bukkit.craftbukkit;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.World;
public class CraftChunk implements Chunk { public class CraftChunk implements Chunk {
private final CraftWorld world;
private final int x; private final int x;
private final int z; 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.x = x;
this.z = z; this.z = z;
} }
/**
* Gets the world containing this chunk
*
* @return World
*/
public World getWorld() {
return world;
}
/** /**
* Gets the X-coordinate of this chunk * Gets the X-coordinate of this chunk
* *

Datei anzeigen

@ -52,7 +52,7 @@ public class CraftWorld implements World {
Chunk chunk = chunkCache.get(loc); Chunk chunk = chunkCache.get(loc);
if (chunk == null) { if (chunk == null) {
chunk = new CraftChunk(x, z); chunk = new CraftChunk(this, x, z);
chunkCache.put(loc, chunk); chunkCache.put(loc, chunk);
} }