当前位置: 首页>>代码示例>>Java>>正文


Java ItemStackHelper.saveAllItems方法代码示例

本文整理汇总了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;
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:25,代码来源:TileEntityAmmoFurnace.java

示例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;
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:18,代码来源:TileKeypunch.java

示例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;
}
 
开发者ID:notabadminer,项目名称:UniversalCoins,代码行数:18,代码来源:TilePowerReceiver.java

示例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;
}
 
开发者ID:notabadminer,项目名称:UniversalCoins,代码行数:18,代码来源:TilePackager.java

示例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;
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:18,代码来源:TileEntityEnergyDepositioner.java

示例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;
}
 
开发者ID:ToroCraft,项目名称:Minecoprocessors,代码行数:15,代码来源:TileEntityMinecoprocessor.java

示例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;
}
 
开发者ID:jaquadro,项目名称:GardenStuff,代码行数:13,代码来源:TileBloomeryFurnace.java

示例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);
   }
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:15,代码来源:EntityCrystalChestMinecartBase.java

示例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);
		}
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:16,代码来源:InventoryBackpack.java

示例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);
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:8,代码来源:TileEntityCaseBase.java

示例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;
}
 
开发者ID:ToroCraft,项目名称:ToroChess,代码行数:13,代码来源:ChessControlRecipe.java

示例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;
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:11,代码来源:BlueprintState.java

示例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;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:11,代码来源:TileEntityLimitableChest.java

示例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;
}
 
开发者ID:notabadminer,项目名称:UniversalCoins,代码行数:13,代码来源:TilePowerTransmitter.java

示例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;
}
 
开发者ID:notabadminer,项目名称:UniversalCoins,代码行数:14,代码来源:TileTradeStation.java


注:本文中的net.minecraft.inventory.ItemStackHelper.saveAllItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。