use of forestry.mail.network.PacketPOBoxInfo in project ForestryMC by ForestryMC.
the class PacketHandlerMail method onPacketData.
@Override
public boolean onPacketData(int packetID, DataInputStream data, EntityPlayer player) throws IOException {
PacketUpdate packet;
switch(packetID) {
case PacketIds.LETTER_INFO:
PacketLetterInfo packetT = new PacketLetterInfo();
packetT.readData(data);
onLetterInfo(packetT);
return true;
case PacketIds.POBOX_INFO:
PacketPOBoxInfo packetP = new PacketPOBoxInfo();
packetP.readData(data);
onPOBoxInfo(packetP);
return true;
case PacketIds.LETTER_RECIPIENT:
packet = new PacketUpdate();
packet.readData(data);
onLetterRecipient(player, packet);
return true;
case PacketIds.LETTER_TEXT:
packet = new PacketUpdate();
packet.readData(data);
onLetterText(player, packet);
return true;
case PacketIds.TRADING_ADDRESS_SET:
packet = new PacketUpdate();
packet.readData(data);
onAddressSet(player, packet);
return true;
case PacketIds.POBOX_INFO_REQUEST:
onPOBoxInfoRequest(player);
return true;
}
return false;
}
use of forestry.mail.network.PacketPOBoxInfo in project ForestryMC by ForestryMC.
the class PacketHandlerMail method onPOBoxInfoRequest.
private void onPOBoxInfoRequest(EntityPlayer player) {
MailAddress address = new MailAddress(player.getGameProfile());
POBox pobox = PostRegistry.getPOBox(player.worldObj, address);
if (pobox == null) {
return;
}
Proxies.net.sendToPlayer(new PacketPOBoxInfo(PacketIds.POBOX_INFO, pobox.getPOBoxInfo()), player);
}
Aggregations