本文整理汇总了Java中net.minecraft.world.chunk.Chunk.NULL_BLOCK_STORAGE属性的典型用法代码示例。如果您正苦于以下问题:Java Chunk.NULL_BLOCK_STORAGE属性的具体用法?Java Chunk.NULL_BLOCK_STORAGE怎么用?Java Chunk.NULL_BLOCK_STORAGE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.world.chunk.Chunk
的用法示例。
在下文中一共展示了Chunk.NULL_BLOCK_STORAGE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractChunkData
public int extractChunkData(PacketBuffer p_189555_1_, Chunk p_189555_2_, boolean p_189555_3_, int p_189555_4_)
{
int i = 0;
ExtendedBlockStorage[] aextendedblockstorage = p_189555_2_.getBlockStorageArray();
int j = 0;
for (int k = aextendedblockstorage.length; j < k; ++j)
{
ExtendedBlockStorage extendedblockstorage = aextendedblockstorage[j];
if (extendedblockstorage != Chunk.NULL_BLOCK_STORAGE && (!this.doChunkLoad() || !extendedblockstorage.isEmpty()) && (p_189555_4_ & 1 << j) != 0)
{
i |= 1 << j;
extendedblockstorage.getData().write(p_189555_1_);
p_189555_1_.writeBytes(extendedblockstorage.getBlocklightArray().getData());
if (p_189555_3_)
{
p_189555_1_.writeBytes(extendedblockstorage.getSkylightArray().getData());
}
}
}
if (this.doChunkLoad())
{
p_189555_1_.writeBytes(p_189555_2_.getBiomeArray());
}
return i;
}
示例2: calculateChunkSize
protected int calculateChunkSize(Chunk chunkIn, boolean p_189556_2_, int p_189556_3_)
{
int i = 0;
ExtendedBlockStorage[] aextendedblockstorage = chunkIn.getBlockStorageArray();
int j = 0;
for (int k = aextendedblockstorage.length; j < k; ++j)
{
ExtendedBlockStorage extendedblockstorage = aextendedblockstorage[j];
if (extendedblockstorage != Chunk.NULL_BLOCK_STORAGE && (!this.doChunkLoad() || !extendedblockstorage.isEmpty()) && (p_189556_3_ & 1 << j) != 0)
{
i = i + extendedblockstorage.getData().getSerializedSize();
i = i + extendedblockstorage.getBlocklightArray().getData().length;
if (p_189556_2_)
{
i += extendedblockstorage.getSkylightArray().getData().length;
}
}
}
if (this.doChunkLoad())
{
i += chunkIn.getBiomeArray().length;
}
return i;
}
示例3: getStorage
/**
* Get block storage array for y-coordinate
* Returns null in case block is outside
* @param chunk Target chunk
* @param y Block height inside chunk
* @return Block storage or null
*/
private static ExtendedBlockStorage getStorage(Chunk chunk, int y) {
ExtendedBlockStorage[] storage = chunk.getBlockStorageArray();
if (y < 0 || y >= 256) {
return null;
}
int i = y >> 4;
if (storage[i] == Chunk.NULL_BLOCK_STORAGE) {
storage[i] = new ExtendedBlockStorage(i << 4, !chunk.getWorld().provider.getHasNoSky());
chunk.generateSkylightMap();
}
return storage[i];
}
示例4: getStorage
/**
* Get block storage array for y-coordinate
* Returns null in case block is outside
* @param chunk Target chunk
* @param y Block height inside chunk
* @return Block storage or null
*/
private static ExtendedBlockStorage getStorage(Chunk chunk, int y) {
ExtendedBlockStorage[] storage = chunk.getBlockStorageArray();
if (y < 0 || y >= 256) {
return null;
}
int i = y >> 4;
if (storage[i] == Chunk.NULL_BLOCK_STORAGE) {
storage[i] = new ExtendedBlockStorage(i << 4, chunk.getWorld().provider.hasSkyLight());
chunk.generateSkylightMap();
}
return storage[i];
}