Search in sources :

Example 6 with PacketGuiSelectRequest

use of forestry.core.network.packets.PacketGuiSelectRequest in project ForestryMC by ForestryMC.

the class GuiCatalogue method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    switch(button.id) {
        case 0:
            mc.player.closeScreen();
            break;
        case // next page
        2:
            NetworkUtil.sendToServer(new PacketGuiSelectRequest(0, 0));
            break;
        case // previous page
        3:
            NetworkUtil.sendToServer(new PacketGuiSelectRequest(1, 0));
            break;
        case // cycle filter
        4:
            NetworkUtil.sendToServer(new PacketGuiSelectRequest(2, 0));
            break;
        case 5:
            ITradeStationInfo info = container.getTradeInfo();
            if (info != null) {
                SessionVars.setStringVar("mail.letter.recipient", info.getAddress().getName());
                SessionVars.setStringVar("mail.letter.addressee", EnumAddressee.TRADER.toString());
            }
            mc.player.closeScreen();
            break;
    }
}
Also used : PacketGuiSelectRequest(forestry.core.network.packets.PacketGuiSelectRequest) ITradeStationInfo(forestry.api.mail.ITradeStationInfo)

Aggregations

PacketGuiSelectRequest (forestry.core.network.packets.PacketGuiSelectRequest)6 ITradeStationInfo (forestry.api.mail.ITradeStationInfo)1 IForestryPacketServer (forestry.core.network.IForestryPacketServer)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1