Package forestry.api.mail

Examples of forestry.api.mail.IMailAddress


    if (!Proxies.common.isSimulating(Proxies.common.getRenderWorld()))
      Proxies.net.sendToServer(new ForestryPacket(PacketIds.POBOX_INFO_REQUEST));
    else {
      GameProfile profile = Proxies.common.getClientInstance().thePlayer.getGameProfile();
      IMailAddress address = PostManager.postRegistry.getMailAddress(profile);
      POBox pobox = PostRegistry.getPOBox(Proxies.common.getRenderWorld(), address);
      if (pobox != null)
        setPOBoxInfo(Proxies.common.getRenderWorld(), address, pobox.getPOBoxInfo());
    }
  }
View Full Code Here


  public void onContainerClosed(EntityPlayer entityplayer) {

    if (Proxies.common.isSimulating(entityplayer.worldObj)) {
      ILetter letter = letterInventory.getLetter();
      if (!letter.isProcessed()) {
        IMailAddress sender = PostManager.postRegistry.getMailAddress(entityplayer.getGameProfile());
        letter.setSender(sender);
      }
    }

    super.onContainerClosed(entityplayer);
View Full Code Here

  public void handleSetRecipient(EntityPlayer player, PacketUpdate packet) {
    String recipientName = packet.payload.stringPayload[0];
    String typeName = packet.payload.stringPayload[1];

    EnumAddressee type = EnumAddressee.fromString(typeName);
    IMailAddress recipient;
    if (type == EnumAddressee.PLAYER) {
      GameProfile gameProfile = MinecraftServer.getServer().func_152358_ax().func_152655_a(recipientName);
      if (gameProfile == null)
        gameProfile = new GameProfile(new UUID(0, 0), recipientName);
      recipient = PostManager.postRegistry.getMailAddress(gameProfile);
View Full Code Here

    super.initGui();

    Keyboard.enableRepeatEvents(true);

    address = new GuiTextField(this.fontRendererObj, guiLeft + 46, guiTop + 13, 93, 13);
    IMailAddress recipient = container.getRecipient();
    if (recipient != null) {
      address.setText(recipient.getName());
    }

    text = new GuiTextBox(this.fontRendererObj, guiLeft + 17, guiTop + 31, 122, 57);
    text.setMaxStringLength(128);
    if (!container.getText().isEmpty())
View Full Code Here

  public ItemStack slotClick(int slotIndex, int button, int par3, EntityPlayer player) {
    ItemStack stack = super.slotClick(slotIndex, button, par3, player);

    if (slotIndex >= SLOT_LETTERS && slotIndex < SLOT_LETTERS + SLOT_LETTERS_COUNT) {
      if (Proxies.common.isSimulating(player.worldObj) && mailinventory != null) {
        IMailAddress address = PostManager.postRegistry.getMailAddress(player.getGameProfile());
        PluginMail.proxy.setPOBoxInfo(mailbox.getWorldObj(), address, mailinventory.getPOBoxInfo());
      }
    }

    return stack;
View Full Code Here

    payload.stringPayload[0] = addressName;

    PacketUpdate packet = new PacketUpdate(PacketIds.TRADING_ADDRESS_SET, payload);
    Proxies.net.sendToServer(packet);

    IMailAddress address = PostManager.postRegistry.getMailAddress(addressName);
    machine.setAddress(address);
  }
View Full Code Here

    machine.setAddress(address);
  }

  public void handleSetAddress(PacketUpdate packet) {
    String addressName = packet.payload.stringPayload[0];
    IMailAddress address = PostManager.postRegistry.getMailAddress(addressName);
    machine.setAddress(address);
  }
View Full Code Here

      this.address = PostManager.postRegistry.getMailAddress(player);

    } else if (type == EnumAddressee.TRADER) {
      if (data.readShort() < 0)
        return;
      IMailAddress address = PostManager.postRegistry.getMailAddress(data.readUTF());
      GameProfile owner = new GameProfile(new UUID(data.readLong(), data.readLong()), data.readUTF());
      ItemStack tradegood;
      ItemStack[] required;

      tradegood = readItemStack(data);
View Full Code Here

  public IInventory getOrCreateMailInventory(World world, GameProfile playerProfile) {
    if (!Proxies.common.isSimulating(world))
      return new InventoryAdapter(POBox.SLOT_SIZE, "Letters");

    IMailAddress address = PostManager.postRegistry.getMailAddress(playerProfile);
    return PostRegistry.getOrCreatePOBox(worldObj, address);
  }
View Full Code Here

  @Override
  public boolean hasRecipient() {
    if (getRecipients().length <= 0)
      return false;

    IMailAddress recipient = getRecipients()[0];
    if (recipient == null)
      return false;

    if (StringUtils.isBlank(recipient.getName()))
      return false;

    return true;
  }
View Full Code Here

TOP

Related Classes of forestry.api.mail.IMailAddress

Copyright © 2018 www.massapicom. 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.