当前位置: 首页>>代码示例>>Java>>正文


Java Chunk.NULL_BLOCK_STORAGE属性代码示例

本文整理汇总了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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:30,代码来源:SPacketChunkData.java

示例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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:29,代码来源:SPacketChunkData.java

示例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];
}
 
开发者ID:ternsip,项目名称:StructPro,代码行数:19,代码来源:UWorld.java

示例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];
}
 
开发者ID:ternsip,项目名称:StructPro,代码行数:19,代码来源:UWorld.java


注:本文中的net.minecraft.world.chunk.Chunk.NULL_BLOCK_STORAGE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。