Updated CraftBukkit to 1.2

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot
2012-03-01 10:49:23 +00:00
parent d61b0b611f
commit 5c717f8732
9 changed files with 41 additions and 23 deletions

View File

@@ -15,6 +15,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.ChunkSnapshot;
import net.minecraft.server.BiomeBase;
import net.minecraft.server.WorldChunkManager;
import org.apache.commons.lang.NotImplementedException;
public class CraftChunk implements Chunk {
private WeakReference<net.minecraft.server.Chunk> weakChunk;
@@ -135,9 +136,11 @@ public class CraftChunk implements Chunk {
public ChunkSnapshot getChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain) {
net.minecraft.server.Chunk chunk = getHandle();
byte[] buf = new byte[32768 + 16384 + 16384 + 16384]; // Get big enough buffer for whole chunk
chunk.getData(buf, 0, 0, 0, 16, 128, 16, 0); // Get whole chunk
//chunk.getData(buf, 0, 0, 0, 16, 128, 16, 0); // Get whole chunk
byte[] hmap = null;
if (true) throw new NotImplementedException("Chunk snapshots do not yet work"); // TODO: Snapshots.
if (includeMaxblocky) {
hmap = new byte[256]; // Get copy of height map
System.arraycopy(chunk.heightMap, 0, hmap, 0, 256);