本文整理汇总了Java中cn.nukkit.level.format.mcregion.McRegion类的典型用法代码示例。如果您正苦于以下问题:Java McRegion类的具体用法?Java McRegion怎么用?Java McRegion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
McRegion类属于cn.nukkit.level.format.mcregion包,在下文中一共展示了McRegion类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEmptyChunkPayload
import cn.nukkit.level.format.mcregion.McRegion; //导入依赖的package包/类
public static byte[] getEmptyChunkPayload() {
BaseFullChunk chunk = new Chunk(McRegion.class);
byte[] tiles = new byte[0];
BinaryStream extraData = new BinaryStream();
BinaryStream stream = new BinaryStream();
stream.put(chunk.getBlockIdArray());
stream.put(chunk.getBlockDataArray());
stream.put(chunk.getBlockSkyLightArray());
stream.put(chunk.getBlockLightArray());
for (int height : chunk.getHeightMapArray()) {
stream.putByte((byte) (height & 0xff));
}
for (int color : chunk.getBiomeColorArray()) {
stream.put(Binary.writeInt(color));
}
stream.put(extraData.getBuffer());
stream.put(tiles);
return stream.getBuffer();
}
示例2: from
import cn.nukkit.level.format.mcregion.McRegion; //导入依赖的package包/类
LevelProviderConverter from(LevelProvider provider) {
if (!(provider instanceof McRegion) && !(provider instanceof LevelDB)) {
throw new IllegalArgumentException("From type can be only McRegion or LevelDB");
}
this.provider = provider;
return this;
}