本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}