Interface IPostalCarrier


public interface IPostalCarrier
Postal Carriers are systems which can be hooked into Forestry's mail system to handle mail delivery.

The two available carriers in vanilla Forestry are "player" - Delivers mail to individual players. "trader" - Handles mail addressed to trade stations.

  • Method Details

    • getDescriptionId

      String getDescriptionId()
      Returns:
      The translation key for the human-readable name for this carrier.
    • getSprite

      net.minecraft.client.renderer.texture.TextureAtlasSprite getSprite()
      Sprite registered to the Gui Texture Map at ITextureManager. Must be 26 pixels wide and 15 pixels tall. The texture itself must be 32x32 square.
    • deliverLetter

      IPostalState deliverLetter(net.minecraft.server.level.ServerLevel world, IPostOffice office, IMailAddress recipient, net.minecraft.world.item.ItemStack letterstack, boolean doDeliver)
      Handle delivery of a letter addressed to this carrier.
      Parameters:
      world - The world the IPostOffice handles.
      office - {link @IPostOffice} which received this letter and handed it to the carrier.
      recipient - An identifier for the recipient as typed by the player into the address field.
      letterstack - ItemStack representing the letter. See LetterUtils for helper functions to validate and extract it.
      doDeliver - Whether or not the letter is supposed to actually be delivered or if delivery is only to be simulated.
      Returns:
      {link IPostalState} holding information on success or failure for delivery.
    • getRecipient

      IMailAddress getRecipient(net.minecraft.server.MinecraftServer minecraftServer, String recipientName)