Search in sources :

Example 1 with PacketUpdate

use of forestry.core.network.PacketUpdate in project ForestryMC by ForestryMC.

the class ContainerImprinter method sendSelection.

public void sendSelection(EntityPlayer player) {
    PacketPayload payload = new PacketPayload(2, 0, 0);
    payload.intPayload[0] = inventory.getPrimaryIndex();
    payload.intPayload[1] = inventory.getSecondaryIndex();
    Proxies.net.sendToPlayer(new PacketUpdate(PacketIds.GUI_SELECTION, payload), player);
}
Also used : PacketPayload(forestry.core.network.PacketPayload) PacketUpdate(forestry.core.network.PacketUpdate)

Example 2 with PacketUpdate

use of forestry.core.network.PacketUpdate in project ForestryMC by ForestryMC.

the class ContainerImprinter method updateContainer.

public void updateContainer(World world) {
    if (!isNetSynced && !Proxies.common.isSimulating(world)) {
        isNetSynced = true;
        Proxies.net.sendToServer(new PacketUpdate(PacketIds.IMPRINT_SELECTION_GET));
    }
}
Also used : PacketUpdate(forestry.core.network.PacketUpdate)

Example 3 with PacketUpdate

use of forestry.core.network.PacketUpdate in project ForestryMC by ForestryMC.

the class ContainerSolderingIron method sendSelectionChange.

private void sendSelectionChange(PacketPayload payload) {
    PacketUpdate packet = new PacketUpdate(PacketIds.GUI_SELECTION_CHANGE, payload);
    Proxies.net.sendToServer(packet);
}
Also used : PacketUpdate(forestry.core.network.PacketUpdate)

Example 4 with PacketUpdate

use of forestry.core.network.PacketUpdate in project ForestryMC by ForestryMC.

the class ContainerSolderingIron method sendSelection.

public void sendSelection(EntityPlayer player) {
    PacketPayload payload = new PacketPayload(0, 0, 1);
    payload.stringPayload[0] = inventory.getLayout().getUID();
    Proxies.net.sendToPlayer(new PacketUpdate(PacketIds.GUI_SELECTION, payload), player);
}
Also used : PacketPayload(forestry.core.network.PacketPayload) PacketUpdate(forestry.core.network.PacketUpdate)

Example 5 with PacketUpdate

use of forestry.core.network.PacketUpdate 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;
}
Also used : PacketPOBoxInfo(forestry.mail.network.PacketPOBoxInfo) PacketUpdate(forestry.core.network.PacketUpdate) PacketLetterInfo(forestry.mail.network.PacketLetterInfo)

Aggregations

PacketUpdate (forestry.core.network.PacketUpdate)22 PacketPayload (forestry.core.network.PacketPayload)17 ItemStack (net.minecraft.item.ItemStack)3 PacketSocketUpdate (forestry.core.network.PacketSocketUpdate)2 TileEntity (net.minecraft.tileentity.TileEntity)2 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 IToolPipette (forestry.api.core.IToolPipette)1 IMailAddress (forestry.api.mail.IMailAddress)1 PacketLetterInfo (forestry.mail.network.PacketLetterInfo)1 PacketPOBoxInfo (forestry.mail.network.PacketPOBoxInfo)1