use of forestry.api.mail.IMailAddress 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.IMailAddress in project ForestryMC by ForestryMC.
the class GuiLetter method initGui.
@Override
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
address = new GuiTextField(0, this.fontRenderer, guiLeft + 46, guiTop + 13, 93, 13);
IMailAddress recipient = container.getRecipient();
if (recipient != null) {
address.setText(recipient.getName());
}
text = new GuiTextBox(1, this.fontRenderer, guiLeft + 17, guiTop + 31, 122, 57);
text.setMaxStringLength(128);
if (!container.getText().isEmpty()) {
text.setText(container.getText());
}
}
use of forestry.api.mail.IMailAddress in project ForestryMC by ForestryMC.
the class TileTrader method handleSetAddressRequest.
public void handleSetAddressRequest(String addressName) {
IMailAddress address = PostManager.postRegistry.getMailAddress(addressName);
setAddress(address);
IMailAddress newAddress = getAddress();
String newAddressName = newAddress.getName();
if (newAddressName.equals(addressName)) {
PacketTraderAddressResponse packetResponse = new PacketTraderAddressResponse(this, addressName);
NetworkUtil.sendNetworkPacket(packetResponse, pos, world);
}
}
use of forestry.api.mail.IMailAddress in project ForestryMC by ForestryMC.
the class TileTrader method handleSetAddressResponse.
@SideOnly(Side.CLIENT)
public void handleSetAddressResponse(String addressName) {
IMailAddress address = PostManager.postRegistry.getMailAddress(addressName);
setAddress(address);
}
Aggregations