mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-11 02:37:36 +01:00
Implemented Chunk.getWorld()
This commit is contained in:
parent
8680ee387f
commit
a2c944d3c0
@ -2,16 +2,28 @@
|
||||
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
|
||||
*
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user