本文整理汇总了Java中net.minecraft.world.chunk.Chunk.setStorageArrays方法的典型用法代码示例。如果您正苦于以下问题:Java Chunk.setStorageArrays方法的具体用法?Java Chunk.setStorageArrays怎么用?Java Chunk.setStorageArrays使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.chunk.Chunk
的用法示例。
在下文中一共展示了Chunk.setStorageArrays方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readChunkFromNBT
import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
/**
* Reads the data stored in the passed NBTTagCompound and creates a Chunk with that data in the passed World.
* Returns the created Chunk.
*/
private Chunk readChunkFromNBT(World worldIn, NBTTagCompound compound)
{
int i = compound.getInteger("xPos");
int j = compound.getInteger("zPos");
Chunk chunk = new Chunk(worldIn, i, j);
chunk.setHeightMap(compound.getIntArray("HeightMap"));
chunk.setTerrainPopulated(compound.getBoolean("TerrainPopulated"));
chunk.setLightPopulated(compound.getBoolean("LightPopulated"));
chunk.setInhabitedTime(compound.getLong("InhabitedTime"));
NBTTagList nbttaglist = compound.getTagList("Sections", 10);
int k = 16;
ExtendedBlockStorage[] aextendedblockstorage = new ExtendedBlockStorage[16];
boolean flag = !worldIn.provider.getHasNoSky();
for (int l = 0; l < nbttaglist.tagCount(); ++l)
{
NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(l);
int i1 = nbttagcompound.getByte("Y");
ExtendedBlockStorage extendedblockstorage = new ExtendedBlockStorage(i1 << 4, flag);
byte[] abyte = nbttagcompound.getByteArray("Blocks");
NibbleArray nibblearray = new NibbleArray(nbttagcompound.getByteArray("Data"));
NibbleArray nibblearray1 = nbttagcompound.hasKey("Add", 7) ? new NibbleArray(nbttagcompound.getByteArray("Add")) : null;
extendedblockstorage.getData().setDataFromNBT(abyte, nibblearray, nibblearray1);
extendedblockstorage.setBlocklightArray(new NibbleArray(nbttagcompound.getByteArray("BlockLight")));
if (flag)
{
extendedblockstorage.setSkylightArray(new NibbleArray(nbttagcompound.getByteArray("SkyLight")));
}
extendedblockstorage.removeInvalidBlocks();
aextendedblockstorage[i1] = extendedblockstorage;
}
chunk.setStorageArrays(aextendedblockstorage);
if (compound.hasKey("Biomes", 7))
{
chunk.setBiomeArray(compound.getByteArray("Biomes"));
}
// End this method here and split off entity loading to another method
return chunk;
}