use of forestry.api.mail.ILetter in project ForestryMC by ForestryMC.
the class ContainerLetter method onContainerClosed.
@Override
public void onContainerClosed(EntityPlayer entityplayer) {
if (!entityplayer.world.isRemote) {
ILetter letter = inventory.getLetter();
if (!letter.isProcessed()) {
IMailAddress sender = PostManager.postRegistry.getMailAddress(entityplayer.getGameProfile());
letter.setSender(sender);
}
}
inventory.onLetterClosed();
super.onContainerClosed(entityplayer);
}
use of forestry.api.mail.ILetter in project ForestryMC by ForestryMC.
the class TileMailbox method tryDispatchLetter.
private IPostalState tryDispatchLetter(ItemStack letterStack) {
ILetter letter = PostManager.postRegistry.getLetter(letterStack);
IPostalState result;
if (letter != null) {
result = PostManager.postRegistry.getPostOffice(world).lodgeLetter(world, letterStack, true);
} else {
result = EnumDeliveryState.NOT_MAILABLE;
}
return result;
}
Aggregations