Package forestry.api.mail

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


        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

      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

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.