本文整理汇总了Java中net.minecraft.util.NonNullList.func_191197_a方法的典型用法代码示例。如果您正苦于以下问题:Java NonNullList.func_191197_a方法的具体用法?Java NonNullList.func_191197_a怎么用?Java NonNullList.func_191197_a使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.NonNullList
的用法示例。
在下文中一共展示了NonNullList.func_191197_a方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRemainingItems
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
{
NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>func_191197_a(inv.getSizeInventory(), ItemStack.field_190927_a);
for (int i = 0; i < nonnulllist.size(); ++i)
{
ItemStack itemstack = inv.getStackInSlot(i);
if (itemstack.getItem().hasContainerItem())
{
nonnulllist.set(i, new ItemStack(itemstack.getItem().getContainerItem()));
}
}
return nonnulllist;
}
示例2: getRemainingItems
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting craftMatrix, World worldIn)
{
for (IRecipe irecipe : this.recipes)
{
if (irecipe.matches(craftMatrix, worldIn))
{
return irecipe.getRemainingItems(craftMatrix);
}
}
NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>func_191197_a(craftMatrix.getSizeInventory(), ItemStack.field_190927_a);
for (int i = 0; i < nonnulllist.size(); ++i)
{
nonnulllist.set(i, craftMatrix.getStackInSlot(i));
}
return nonnulllist;
}
示例3: readFromNBT
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound compound)
{
super.readFromNBT(compound);
this.inventory = NonNullList.<ItemStack>func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a);
if (!this.checkLootAndRead(compound))
{
ItemStackHelper.func_191283_b(compound, this.inventory);
}
if (compound.hasKey("CustomName", 8))
{
this.field_190577_o = compound.getString("CustomName");
}
this.transferCooldown = compound.getInteger("TransferCooldown");
}
示例4: readFromNBT
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound compound)
{
super.readFromNBT(compound);
this.brewingItemStacks = NonNullList.<ItemStack>func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a);
ItemStackHelper.func_191283_b(compound, this.brewingItemStacks);
this.brewTime = compound.getShort("BrewTime");
if (compound.hasKey("CustomName", 8))
{
this.customName = compound.getString("CustomName");
}
this.fuel = compound.getByte("Fuel");
}
示例5: SPacketWindowItems
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public SPacketWindowItems(int p_i47317_1_, NonNullList<ItemStack> p_i47317_2_)
{
this.windowId = p_i47317_1_;
this.itemStacks = NonNullList.<ItemStack>func_191197_a(p_i47317_2_.size(), ItemStack.field_190927_a);
for (int i = 0; i < this.itemStacks.size(); ++i)
{
ItemStack itemstack = (ItemStack)p_i47317_2_.get(i);
if (!itemstack.func_190926_b())
{
this.itemStacks.set(i, itemstack.copy());
}
}
}
示例6: readFromNBT
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound compound)
{
super.readFromNBT(compound);
this.chestContents = NonNullList.<ItemStack>func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a);
if (!this.checkLootAndRead(compound))
{
ItemStackHelper.func_191283_b(compound, this.chestContents);
}
if (compound.hasKey("CustomName", 8))
{
this.field_190577_o = compound.getString("CustomName");
}
}
示例7: func_190586_e
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public void func_190586_e(NBTTagCompound p_190586_1_)
{
this.field_190596_f = NonNullList.<ItemStack>func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a);
if (!this.checkLootAndRead(p_190586_1_) && p_190586_1_.hasKey("Items", 9))
{
ItemStackHelper.func_191283_b(p_190586_1_, this.field_190596_f);
}
if (p_190586_1_.hasKey("CustomName", 8))
{
this.field_190577_o = p_190586_1_.getString("CustomName");
}
}
示例8: readFromNBT
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound compound)
{
super.readFromNBT(compound);
this.stacks = NonNullList.<ItemStack>func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a);
if (!this.checkLootAndRead(compound))
{
ItemStackHelper.func_191283_b(compound, this.stacks);
}
if (compound.hasKey("CustomName", 8))
{
this.field_190577_o = compound.getString("CustomName");
}
}
示例9: InventoryCrafting
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public InventoryCrafting(Container eventHandlerIn, int width, int height)
{
this.stackList = NonNullList.<ItemStack>func_191197_a(width * height, ItemStack.field_190927_a);
this.eventHandler = eventHandlerIn;
this.inventoryWidth = width;
this.inventoryHeight = height;
}
示例10: InventoryBasic
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public InventoryBasic(String title, boolean customName, int slotCount)
{
this.inventoryTitle = title;
this.hasCustomName = customName;
this.slotsCount = slotCount;
this.inventoryContents = NonNullList.<ItemStack>func_191197_a(slotCount, ItemStack.field_190927_a);
}
示例11: TileEntityShulkerBox
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public TileEntityShulkerBox(@Nullable EnumDyeColor p_i47242_1_)
{
this.field_190596_f = NonNullList.<ItemStack>func_191197_a(27, ItemStack.field_190927_a);
this.field_190599_i = TileEntityShulkerBox.AnimationStatus.CLOSED;
this.field_190602_l = p_i47242_1_;
}
示例12: getRemainingItems
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
{
return NonNullList.<ItemStack>func_191197_a(inv.getSizeInventory(), ItemStack.field_190927_a);
}
示例13: func_190948_a
import net.minecraft.util.NonNullList; //导入方法依赖的package包/类
public void func_190948_a(ItemStack p_190948_1_, EntityPlayer p_190948_2_, List<String> p_190948_3_, boolean p_190948_4_)
{
super.func_190948_a(p_190948_1_, p_190948_2_, p_190948_3_, p_190948_4_);
NBTTagCompound nbttagcompound = p_190948_1_.getTagCompound();
if (nbttagcompound != null && nbttagcompound.hasKey("BlockEntityTag", 10))
{
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("BlockEntityTag");
if (nbttagcompound1.hasKey("LootTable", 8))
{
p_190948_3_.add("???????");
}
if (nbttagcompound1.hasKey("Items", 9))
{
NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>func_191197_a(27, ItemStack.field_190927_a);
ItemStackHelper.func_191283_b(nbttagcompound1, nonnulllist);
int i = 0;
int j = 0;
for (ItemStack itemstack : nonnulllist)
{
if (!itemstack.func_190926_b())
{
++j;
if (i <= 4)
{
++i;
p_190948_3_.add(String.format("%s x%d", new Object[] {itemstack.getDisplayName(), Integer.valueOf(itemstack.func_190916_E())}));
}
}
}
if (j - i > 0)
{
p_190948_3_.add(String.format(TextFormatting.ITALIC + I18n.translateToLocal("container.shulkerBox.more"), new Object[] {Integer.valueOf(j - i)}));
}
}
}
}