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


Java ExtendedBlockStorage.isEmpty方法代码示例

本文整理汇总了Java中net.minecraft.world.chunk.storage.ExtendedBlockStorage.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java ExtendedBlockStorage.isEmpty方法的具体用法?Java ExtendedBlockStorage.isEmpty怎么用?Java ExtendedBlockStorage.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.chunk.storage.ExtendedBlockStorage的用法示例。


在下文中一共展示了ExtendedBlockStorage.isEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAreLevelsEmpty

import net.minecraft.world.chunk.storage.ExtendedBlockStorage; //导入方法依赖的package包/类
/**
 * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty
 * (true) or not (false).
 */
public boolean getAreLevelsEmpty(int startY, int endY)
{
    if (startY < 0)
    {
        startY = 0;
    }

    if (endY >= 256)
    {
        endY = 255;
    }

    for (int i = startY; i <= endY; i += 16)
    {
        ExtendedBlockStorage extendedblockstorage = this.storageArrays[i >> 4];

        if (extendedblockstorage != null && !extendedblockstorage.isEmpty())
        {
            return false;
        }
    }

    return true;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:29,代码来源:Chunk.java

示例2: getAreLevelsEmpty

import net.minecraft.world.chunk.storage.ExtendedBlockStorage; //导入方法依赖的package包/类
/**
 * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty
 * (true) or not (false).
 */
public boolean getAreLevelsEmpty(int startY, int endY)
{
    if (startY < 0)
    {
        startY = 0;
    }

    if (endY >= 256)
    {
        endY = 255;
    }

    for (int i = startY; i <= endY; i += 16)
    {
        ExtendedBlockStorage extendedblockstorage = this.storageArrays[i >> 4];

        if (extendedblockstorage != NULL_BLOCK_STORAGE && !extendedblockstorage.isEmpty())
        {
            return false;
        }
    }

    return true;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:29,代码来源:Chunk.java

示例3: extractChunkData

import net.minecraft.world.chunk.storage.ExtendedBlockStorage; //导入方法依赖的package包/类
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,代码行数:31,代码来源:SPacketChunkData.java

示例4: calculateChunkSize

import net.minecraft.world.chunk.storage.ExtendedBlockStorage; //导入方法依赖的package包/类
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,代码行数:30,代码来源:SPacketChunkData.java

示例5: func_179756_a

import net.minecraft.world.chunk.storage.ExtendedBlockStorage; //导入方法依赖的package包/类
public static S21PacketChunkData.Extracted func_179756_a(Chunk p_179756_0_, boolean p_179756_1_, boolean p_179756_2_, int p_179756_3_)
{
    ExtendedBlockStorage[] aextendedblockstorage = p_179756_0_.getBlockStorageArray();
    S21PacketChunkData.Extracted s21packetchunkdata$extracted = new S21PacketChunkData.Extracted();
    List<ExtendedBlockStorage> list = Lists.<ExtendedBlockStorage>newArrayList();

    for (int i = 0; i < aextendedblockstorage.length; ++i)
    {
        ExtendedBlockStorage extendedblockstorage = aextendedblockstorage[i];

        if (extendedblockstorage != null && (!p_179756_1_ || !extendedblockstorage.isEmpty()) && (p_179756_3_ & 1 << i) != 0)
        {
            s21packetchunkdata$extracted.dataSize |= 1 << i;
            list.add(extendedblockstorage);
        }
    }

    s21packetchunkdata$extracted.data = new byte[func_180737_a(Integer.bitCount(s21packetchunkdata$extracted.dataSize), p_179756_2_, p_179756_1_)];
    int j = 0;

    for (ExtendedBlockStorage extendedblockstorage1 : list)
    {
        char[] achar = extendedblockstorage1.getData();

        for (char c0 : achar)
        {
            s21packetchunkdata$extracted.data[j++] = (byte)(c0 & 255);
            s21packetchunkdata$extracted.data[j++] = (byte)(c0 >> 8 & 255);
        }
    }

    for (ExtendedBlockStorage extendedblockstorage2 : list)
    {
        j = func_179757_a(extendedblockstorage2.getBlocklightArray().getData(), s21packetchunkdata$extracted.data, j);
    }

    if (p_179756_2_)
    {
        for (ExtendedBlockStorage extendedblockstorage3 : list)
        {
            j = func_179757_a(extendedblockstorage3.getSkylightArray().getData(), s21packetchunkdata$extracted.data, j);
        }
    }

    if (p_179756_1_)
    {
        func_179757_a(p_179756_0_.getBiomeArray(), s21packetchunkdata$extracted.data, j);
    }

    return s21packetchunkdata$extracted;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:52,代码来源:S21PacketChunkData.java


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