use of cn.nukkit.nbt.stream.NBTOutputStream in project Nukkit by Nukkit.
the class Chunk method clone.
@Override
public BaseChunk clone() {
Chunk chunk = (Chunk) super.clone();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
NBTOutputStream out = new NBTOutputStream(baos);
try {
nbt.write(out);
NBTInputStream in = new NBTInputStream(new ByteArrayInputStream(baos.toByteArray()));
chunk.nbt = new CompoundTag();
chunk.nbt.load(in);
} catch (IOException e) {
}
return chunk;
}
Aggregations