use of forestry.mail.network.packets.PacketLetterInfoResponse in project ForestryMC by ForestryMC.
the class ContainerCatalogue method detectAndSendChanges.
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
if (needsSync) {
for (IContainerListener crafter : listeners) {
crafter.sendWindowProperty(this, 0, stationIndex);
crafter.sendWindowProperty(this, 1, stations.size());
crafter.sendWindowProperty(this, 2, currentFilter);
}
NetworkUtil.sendToPlayer(new PacketLetterInfoResponse(EnumAddressee.TRADER, currentTrade, null), player);
needsSync = false;
}
}
use of forestry.mail.network.packets.PacketLetterInfoResponse in project ForestryMC by ForestryMC.
the class ContainerLetter method handleRequestLetterInfo.
public void handleRequestLetterInfo(EntityPlayer player, String recipientName, EnumAddressee type) {
MinecraftServer server = player.getServer();
if (server == null) {
Log.error("Could not get server");
return;
}
IMailAddress recipient = getRecipient(server, recipientName, type);
getLetter().setRecipient(recipient);
// Update the trading info
if (recipient == null || recipient.getType() == EnumAddressee.TRADER) {
updateTradeInfo(player.world, recipient);
}
// Update info on client
NetworkUtil.sendToPlayer(new PacketLetterInfoResponse(type, tradeInfo, recipient), player);
}
Aggregations