Examples of writeToNBT()


Examples of forestry.api.genetics.IIndividual.writeToNBT()

      if (individual == null)
        return false;

      individual.analyze();
      NBTTagCompound nbttagcompound = new NBTTagCompound();
      individual.writeToNBT(nbttagcompound);
      stackToAnalyze.setTagCompound(nbttagcompound);

      pendingProducts.push(stackToAnalyze);
      setInventorySlotContents(SLOT_ANALYZE, null);
      sendNetworkUpdate();
View Full Code Here

Examples of forestry.api.lepidopterology.IButterfly.writeToNBT()

        if (player != null) {
          PluginLepidopterology.butterflyInterface.getBreedingTracker(player.worldObj, player.getGameProfile()).registerSpecies(butterfly.getGenome().getPrimary());
          PluginLepidopterology.butterflyInterface.getBreedingTracker(player.worldObj, player.getGameProfile()).registerSpecies(butterfly.getGenome().getSecondary());
        }
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        butterfly.writeToNBT(nbttagcompound);
        getStackInSlot(SLOT_SPECIMEN).setTagCompound(nbttagcompound);

        // Decrease energy
        decrStackSize(SLOT_ENERGY, 1);
      }
View Full Code Here

Examples of forestry.api.mail.ILetter.writeToNBT()

    // Mark letter as processed
    letter.setProcessed(true);
    letter.invalidatePostage();
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    letter.writeToNBT(nbttagcompound);
    letterstack.setTagCompound(nbttagcompound);

    this.markDirty();
    return this.letters.tryAddStack(letterstack, true);
  }
View Full Code Here

Examples of forestry.api.mail.ILetter.writeToNBT()

        mail.addStamps(ForestryItem.stamps.getItemStack(stampCount[i], EnumPostage.values()[i].ordinal() - 1));
    }

    // Send the letter
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    mail.writeToNBT(nbttagcompound);

    ItemStack mailstack = ForestryItem.letters.getItemStack(1, ItemLetter.encodeMeta(1, ItemLetter.getType(mail)));
    mailstack.setTagCompound(nbttagcompound);

    IPostalState responseState = PostManager.postRegistry.getPostOffice(world).lodgeLetter(world, mailstack, doLodge);
View Full Code Here

Examples of forestry.api.mail.ILetter.writeToNBT()

      nbttagcompound = new NBTTagCompound();

      ILetter confirm = new Letter(this.address, new MailAddress(this.owner));
      confirm.setText(ordersToFill + " order(s) from " + letter.getSender().getName() + " were filled.");
      confirm.addStamps(ForestryItem.stamps.getItemStack(1, EnumPostage.P_1.ordinal() - 1));
      confirm.writeToNBT(nbttagcompound);
         
      ItemStack confirmstack = ForestryItem.letters.getItemStack(1, ItemLetter.encodeMeta(1, ItemLetter.getType(confirm)));
      confirmstack.setTagCompound(nbttagcompound);

      PostManager.postRegistry.getPostOffice(world).lodgeLetter(world, confirmstack, doLodge);
View Full Code Here

Examples of forestry.apiculture.genetics.Bee.writeToNBT()

    case PRINCESS:
      beeItem = ForestryItem.beePrincessGE.getItemStack();
      break;
    }
    NBTTagCompound nbtTagCompound = new NBTTagCompound();
    bee.writeToNBT(nbtTagCompound);
    beeItem.setTagCompound(nbtTagCompound);

    return beeItem;
  }
View Full Code Here

Examples of forestry.arboriculture.genetics.Tree.writeToNBT()

      break;
    case SAPLING:
      treeItem = ForestryItem.sapling.getItemStack();
    }
    NBTTagCompound nbtTagCompound = new NBTTagCompound();
    tree.writeToNBT(nbtTagCompound);
    treeItem.setTagCompound(nbtTagCompound);
    return treeItem;
  }
}
View Full Code Here

Examples of forestry.core.fluids.tanks.StandardTank.writeToNBT()

    for (byte slot = 0; slot < tanks.size(); slot++) {
      StandardTank tank = tanks.get(slot);
      if (tank.getFluid() != null) {
        NBTTagCompound tag = new NBTTagCompound();
        tag.setByte("tank", slot);
        tank.writeToNBT(tag);
        tagList.appendTag(tag);
      }
    }
    data.setTag("tanks", tagList);
  }
View Full Code Here

Examples of logisticspipes.modules.abstractmodules.LogisticsModule.writeToNBT()

      LogisticsModule module = LogisticsPipes.ModuleItem.getModuleForItem(new ItemStack(LogisticsPipes.ModuleItem, 1, i), null, null, null);
      if(module != null) {
        NBTTagCompound nbt = new NBTTagCompound();
        boolean force = false;
        try {
          module.writeToNBT(nbt);
        } catch(Exception e) {
          force = true;
        }
        if(!nbt.equals(new NBTTagCompound()) || force) {
          craftingManager.addShapelessResetRecipe(LogisticsPipes.ModuleItem, i);
View Full Code Here

Examples of logisticspipes.security.SecuritySettings.writeToNBT()

    if(setting == null && string != null && !string.isEmpty()) {
      setting = new SecuritySettings(string);
      settingsList.put(string, setting);
    }
    NBTTagCompound nbt = new NBTTagCompound();
    setting.writeToNBT(nbt);
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(SecurityStationOpenPlayer.class).setTag(nbt), player);
  }

  public void saveNewSecuritySettings(NBTTagCompound tag) {
    SecuritySettings setting = settingsList.get(tag.getString("name"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.