Package forestry.api.mail
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 Summary
Modifier and TypeMethodDescriptiondeliverLetter(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.getRecipient(net.minecraft.server.MinecraftServer minecraftServer, String recipientName) net.minecraft.client.renderer.texture.TextureAtlasSpriteSprite registered to the Gui Texture Map atITextureManager.
-
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 atITextureManager. 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 theIPostOfficehandles.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. SeeLetterUtilsfor 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)
-