本文整理汇总了Java中net.minecraft.inventory.ItemStackHelper.saveAllItems方法的典型用法代码示例。如果您正苦于以下问题:Java ItemStackHelper.saveAllItems方法的具体用法?Java ItemStackHelper.saveAllItems怎么用?Java ItemStackHelper.saveAllItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.inventory.ItemStackHelper
的用法示例。
在下文中一共展示了ItemStackHelper.saveAllItems方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
compound.setInteger("BurnTime", this.furnaceBurnTime);
compound.setInteger("CookTime", this.cookTime);
compound.setInteger("CookTimeTotal", this.totalCookTime);
ItemStackHelper.saveAllItems(compound, furnaceItemStacks);
/*NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < this.furnaceItemStacks.length; ++i)
if (this.furnaceItemStacks[i] != null) {
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setByte("Slot", (byte) i);
this.furnaceItemStacks[i].writeToNBT(nbttagcompound);
nbttaglist.appendTag(nbttagcompound);
}
compound.setTag("Items", nbttaglist);*/
if (this.hasCustomName())
compound.setString("CustomName", this.furnaceCustomName);
return compound;
}
示例2: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(final NBTTagCompound tag)
{
super.writeToNBT(tag);
tag.setBoolean("isCraftTab", this.isCraftTabProperty.getValue());
final NBTTagCompound craftTag = new NBTTagCompound();
ItemStackHelper.saveAllItems(craftTag, (NonNullList<ItemStack>) this.craftStacks.getModifiableValue());
tag.setTag("craftTag", craftTag);
final NBTTagCompound filterTag = new NBTTagCompound();
ItemStackHelper.saveAllItems(filterTag, (NonNullList<ItemStack>) this.filterStacks.getModifiableValue());
tag.setTag("filterTag", filterTag);
return tag;
}
示例3: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
NBTTagList itemList = new NBTTagList();
ItemStackHelper.saveAllItems(tagCompound, this.inventory);
tagCompound.setLong("coinSum", coinSum);
tagCompound.setInteger("feLevel", feLevel);
tagCompound.setInteger("feOutput", feOutput);
tagCompound.setLong("wfeLevel", wfeLevel);
tagCompound.setString("blockOwner", blockOwner);
if (orientation != null) {
tagCompound.setInteger("orientation", orientation.ordinal());
}
tagCompound.setBoolean("publicAccess", publicAccess);
return tagCompound;
}
示例4: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
NBTTagList itemList = new NBTTagList();
ItemStackHelper.saveAllItems(tagCompound, this.inventory);
tagCompound.setLong("coinSum", coinSum);
tagCompound.setBoolean("cardAvailable", cardAvailable);
tagCompound.setString("customName", customName);
tagCompound.setBoolean("inUse", inUse);
tagCompound.setInteger("packageSize", packageSize);
tagCompound.setString("packageTarget", packageTarget);
tagCompound.setInteger("smallPrice", packageCost[0]);
tagCompound.setInteger("medPrice", packageCost[1]);
tagCompound.setInteger("largePrice", packageCost[2]);
return tagCompound;
}
示例5: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound)
{
super.writeToNBT(nbttagcompound);
nbttagcompound.setInteger("ActivationTimer", activationTimer);
nbttagcompound.setInteger("Tolerance", tolerance);
nbttagcompound.setFloat("PotEnergy", energy);
PEUtils.writeManipulatorNBT(this, nbttagcompound);
ItemStackHelper.saveAllItems(nbttagcompound, containerItemStacks);
nbttagcompound.setInteger("ProcessingTime", processingTime);
NBTTagCompound nbtItem = new NBTTagCompound();
if(!processingStack.isEmpty())
processingStack.writeToNBT(nbtItem);
nbttagcompound.setTag("ProcessingStack", nbtItem);
return nbttagcompound;
}
示例6: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound cIn) {
NBTTagCompound c = super.writeToNBT(cIn);
c.setTag(NBT_PROCESSOR, processor.writeToNBT());
c.setShort(NBT_LOAD_TIME, (short) loadTime);
ItemStackHelper.saveAllItems(c, codeItemStacks);
if (this.hasCustomName()) {
c.setString(NBT_CUSTOM_NAME, this.customName);
}
return c;
}
示例7: writeToFixedNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
protected NBTTagCompound writeToFixedNBT (NBTTagCompound tag) {
tag = super.writeToFixedNBT(tag);
tag.setShort("BurnTime", (short)furnaceBurnTime);
tag.setShort("CookTime", (short)cookTime);
tag.setShort("CookTimeTotal", (short)totalCookTime);
ItemStackHelper.saveAllItems(tag, furnaceItemStacks);
return tag;
}
示例8: writeEntityToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
protected void writeEntityToNBT(NBTTagCompound compound)
{
if (this.hasDisplayTile())
{
compound.setBoolean("CustomDisplayTile", true);
IBlockState iblockstate = this.getDisplayTile();
ResourceLocation resourcelocation = Block.REGISTRY.getNameForObject(iblockstate.getBlock());
compound.setString("DisplayTile", resourcelocation == null ? "" : resourcelocation.toString());
compound.setInteger("DisplayData", iblockstate.getBlock().getMetaFromState(iblockstate));
compound.setInteger("DisplayOffset", this.getDisplayTileOffset());
}
ItemStackHelper.saveAllItems(compound, inventory);
}
示例9: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
public void writeToNBT(NBTTagCompound nbt){
if(player == null || !player.getEntityWorld().isRemote) {
ItemStack found = player == null ? ItemStackTools.getEmptyStack() : findRealStack(player);
ItemStack backpackToUse = (ItemStackTools.isValid(found) ? found : backpack);
backpack = backpackToUse;
nbt = backpackToUse.getTagCompound();
if(!Strings.isNullOrEmpty(tagName)){
NBTTagCompound nbtInv = new NBTTagCompound();
ItemStackHelper.saveAllItems(nbtInv, slots);
nbt.setTag(tagName, nbtInv);
} else {
ItemUtil.writeInventoryToNBT(slots, nbt);
}
}
}
示例10: writeToStack
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
public void writeToStack(ItemStack stack){
NBTTagCompound nbt = ItemNBTHelper.getCompound(stack);
NBTTagCompound invNBT = new NBTTagCompound();
ItemStackHelper.saveAllItems(invNBT, inventory);
nbt.setTag(NBT_INVENTORY, invNBT);
stack.setTagCompound(nbt);
}
示例11: getCraftingResult
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
public ItemStack getCraftingResult(InventoryCrafting inv) {
NonNullList<ItemStack> list = NonNullList.<ItemStack>withSize(2, ItemStack.EMPTY);
list.set(0, inv.getStackInSlot(INDEX_WHITE_BLOCK));
list.set(1, inv.getStackInSlot(INDEX_BLACK_BLOCK));
NBTTagCompound c = new NBTTagCompound();
ItemStackHelper.saveAllItems(c, list);
ItemStack output = getRecipeOutput().copy();
output.setTagCompound(c);
return output;
}
示例12: toNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
public NBTTagCompound toNBT()
{
final NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("currentStep", this.currentStep);
tag.setInteger("currentTime", this.currentTime);
tag.setBoolean("isStepStackComplete", this.isStepStackComplete);
ItemStackHelper.saveAllItems(tag, this.currentStacks);
return tag;
}
示例13: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
ItemStackHelper.saveAllItems(compound, this.chestContents);
if (this.hasCustomName()) {
compound.setString("CustomName", this.customName);
}
return compound;
}
示例14: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
NBTTagList itemList = new NBTTagList();
ItemStackHelper.saveAllItems(tagCompound, this.inventory);
tagCompound.setLong("coinSum", coinSum);
tagCompound.setInteger("feLevel", feLevel);
tagCompound.setInteger("kfeSold", kfeSold);
tagCompound.setString("blockOwner", blockOwner);
tagCompound.setBoolean("publicAccess", publicAccess);
return tagCompound;
}
示例15: writeToNBT
import net.minecraft.inventory.ItemStackHelper; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
NBTTagList itemList = new NBTTagList();
ItemStackHelper.saveAllItems(tagCompound, this.inventory);
tagCompound.setInteger("AutoMode", autoMode);
tagCompound.setInteger("CoinMode", coinMode);
tagCompound.setInteger("CoinSum", coinSum);
tagCompound.setBoolean("AutoModeButtonActive", autoModeButtonActive);
tagCompound.setBoolean("InUse", inUse);
tagCompound.setBoolean("PublicAccess", publicAccess);
return tagCompound;
}