public static NonNullList<Pair<Integer, ItemStack>> readItemsFromNBT(NBTTagCompound tagCompound)
{
NonNullList<Pair<Integer, ItemStack>> items = NonNullList.create();
NBTTagList nbtList = tagCompound.getTagList("Items", 10);
for (int i = 0; i < nbtList.tagCount(); ++i)
{
NBTTagCompound nbtTagCompound = nbtList.getCompoundTagAt(i);
NBTBase nbt = nbtTagCompound.getTag("Slot");
int j;
if (nbt instanceof NBTTagByte)
{
j = nbtTagCompound.getByte("Slot") & 255;
} else
{
j = nbtTagCompound.getShort("Slot");
}
if (j >= 0)
{
ItemStack itemstack = new ItemStack(nbtTagCompound);
items.add(Pair.of(j, itemstack));
}
}
return items;
}
Util.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:chesttransporter
作者:
评论列表
文章目录