本文整理汇总了Java中net.minecraft.world.chunk.storage.ExtendedBlockStorage.getData方法的典型用法代码示例。如果您正苦于以下问题:Java ExtendedBlockStorage.getData方法的具体用法?Java ExtendedBlockStorage.getData怎么用?Java ExtendedBlockStorage.getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.chunk.storage.ExtendedBlockStorage
的用法示例。
在下文中一共展示了ExtendedBlockStorage.getData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}