mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-17 22:28:15 +01:00
Handle chunks with no biome data
This commit is contained in:
parent
4afef4503a
commit
09ccad6eca
@ -9,6 +9,7 @@ import org.dynmap.renderer.DynmapBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import scala.actors.threadpool.Arrays;
|
||||
|
||||
/**
|
||||
* Represents a static, thread-safe snapshot of chunk of blocks
|
||||
@ -154,7 +155,11 @@ public class ChunkSnapshot
|
||||
}
|
||||
/* Get biome data */
|
||||
if (nbt.hasKey("Biomes")) {
|
||||
this.biome = nbt.getByteArray("Biomes");
|
||||
byte[] b = nbt.getByteArray("Biomes");
|
||||
if (b.length < COLUMNS_PER_CHUNK) {
|
||||
b = Arrays.copyOf(b, COLUMNS_PER_CHUNK);
|
||||
}
|
||||
this.biome = b;
|
||||
}
|
||||
else {
|
||||
this.biome = new byte[COLUMNS_PER_CHUNK];
|
||||
|
@ -9,6 +9,7 @@ import org.dynmap.renderer.DynmapBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import scala.actors.threadpool.Arrays;
|
||||
|
||||
/**
|
||||
* Represents a static, thread-safe snapshot of chunk of blocks
|
||||
@ -154,7 +155,11 @@ public class ChunkSnapshot
|
||||
}
|
||||
/* Get biome data */
|
||||
if (nbt.hasKey("Biomes")) {
|
||||
this.biome = nbt.getByteArray("Biomes");
|
||||
byte[] b = nbt.getByteArray("Biomes");
|
||||
if (b.length < COLUMNS_PER_CHUNK) {
|
||||
b = Arrays.copyOf(b, COLUMNS_PER_CHUNK);
|
||||
}
|
||||
this.biome = b;
|
||||
}
|
||||
else {
|
||||
this.biome = new byte[COLUMNS_PER_CHUNK];
|
||||
|
@ -9,6 +9,7 @@ import org.dynmap.renderer.DynmapBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import scala.actors.threadpool.Arrays;
|
||||
|
||||
/**
|
||||
* Represents a static, thread-safe snapshot of chunk of blocks
|
||||
@ -154,7 +155,11 @@ public class ChunkSnapshot
|
||||
}
|
||||
/* Get biome data */
|
||||
if (nbt.hasKey("Biomes")) {
|
||||
this.biome = nbt.getByteArray("Biomes");
|
||||
byte[] b = nbt.getByteArray("Biomes");
|
||||
if (b.length < COLUMNS_PER_CHUNK) {
|
||||
b = Arrays.copyOf(b, COLUMNS_PER_CHUNK);
|
||||
}
|
||||
this.biome = b;
|
||||
}
|
||||
else {
|
||||
this.biome = new byte[COLUMNS_PER_CHUNK];
|
||||
|
@ -11,6 +11,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import scala.actors.threadpool.Arrays;
|
||||
|
||||
/**
|
||||
* Represents a static, thread-safe snapshot of chunk of blocks
|
||||
@ -156,7 +157,11 @@ public class ChunkSnapshot
|
||||
}
|
||||
/* Get biome data */
|
||||
if (nbt.hasKey("Biomes")) {
|
||||
this.biome = nbt.getByteArray("Biomes");
|
||||
byte[] b = nbt.getByteArray("Biomes");
|
||||
if (b.length < COLUMNS_PER_CHUNK) {
|
||||
b = Arrays.copyOf(b, COLUMNS_PER_CHUNK);
|
||||
}
|
||||
this.biome = b;
|
||||
}
|
||||
else {
|
||||
this.biome = new byte[COLUMNS_PER_CHUNK];
|
||||
|
@ -9,6 +9,7 @@ import org.dynmap.renderer.DynmapBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import scala.actors.threadpool.Arrays;
|
||||
|
||||
/**
|
||||
* Represents a static, thread-safe snapshot of chunk of blocks
|
||||
@ -154,7 +155,11 @@ public class ChunkSnapshot
|
||||
}
|
||||
/* Get biome data */
|
||||
if (nbt.hasKey("Biomes")) {
|
||||
this.biome = nbt.getByteArray("Biomes");
|
||||
byte[] b = nbt.getByteArray("Biomes");
|
||||
if (b.length < COLUMNS_PER_CHUNK) {
|
||||
b = Arrays.copyOf(b, COLUMNS_PER_CHUNK);
|
||||
}
|
||||
this.biome = b;
|
||||
}
|
||||
else {
|
||||
this.biome = new byte[COLUMNS_PER_CHUNK];
|
||||
|
Loading…
Reference in New Issue
Block a user