Search in sources :

Example 16 with PacketPayload

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

the class TileAnalyzer method getPacketPayload.

/* Network */
public PacketPayload getPacketPayload() {
    ItemStack displayStack = getIndividualOnDisplay();
    if (displayStack == null) {
        return null;
    }
    IIndividual displayIndividual = AlleleManager.alleleRegistry.getIndividual(displayStack);
    int type = PluginApiculture.beeInterface.getType(displayStack).ordinal();
    PacketPayload payload = new PacketPayload();
    payload.stringPayload = new String[1];
    payload.shortPayload = new short[2];
    payload.stringPayload[0] = displayIndividual.getIdent();
    payload.shortPayload[0] = (short) type;
    payload.shortPayload[1] = (short) displayStack.stackSize;
    return payload;
}
Also used : IIndividual(forestry.api.genetics.IIndividual) PacketPayload(forestry.core.network.PacketPayload) ItemStack(net.minecraft.item.ItemStack)

Example 17 with PacketPayload

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

the class ContainerLiquidTanks method handlePipetteClickClient.

@SideOnly(Side.CLIENT)
public void handlePipetteClickClient(int slot, EntityPlayer player) {
    ItemStack itemstack = player.inventory.getItemStack();
    if (itemstack == null || !(itemstack.getItem() instanceof IToolPipette)) {
        return;
    }
    PacketPayload payload = new PacketPayload(1, 0, 0);
    payload.intPayload[0] = slot;
    Proxies.net.sendToServer(new PacketUpdate(PacketIds.PIPETTE_CLICK, payload));
}
Also used : PacketPayload(forestry.core.network.PacketPayload) IToolPipette(forestry.api.core.IToolPipette) PacketUpdate(forestry.core.network.PacketUpdate) ItemStack(net.minecraft.item.ItemStack) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 18 with PacketPayload

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

the class Mill method getPacketPayload.

@Override
public PacketPayload getPacketPayload() {
    PacketPayload payload = new PacketPayload(2, 1, 0);
    payload.intPayload[0] = charge;
    payload.intPayload[1] = stage;
    payload.floatPayload[0] = speed;
    return payload;
}
Also used : PacketPayload(forestry.core.network.PacketPayload)

Example 19 with PacketPayload

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

the class MachineTrader method getPacketPayload.

@Override
public PacketPayload getPacketPayload() {
    if (address == null || address.getName() == null) {
        return null;
    }
    PacketPayload payload = new PacketPayload(0, 0, 1);
    payload.stringPayload[0] = address.getName();
    return payload;
}
Also used : PacketPayload(forestry.core.network.PacketPayload)

Example 20 with PacketPayload

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

the class ContainerLetter method setRecipient.

public void setRecipient(String recipientName, EnumAddressee type) {
    if (StringUtils.isBlank(recipientName) || type == null) {
        return;
    }
    // / Send to server
    PacketPayload payload = new PacketPayload(0, 0, 2);
    payload.stringPayload[0] = recipientName;
    payload.stringPayload[1] = type.toString();
    PacketUpdate packet = new PacketUpdate(PacketIds.LETTER_RECIPIENT, payload);
    Proxies.net.sendToServer(packet);
}
Also used : PacketPayload(forestry.core.network.PacketPayload) PacketUpdate(forestry.core.network.PacketUpdate)

Aggregations

PacketPayload (forestry.core.network.PacketPayload)29 PacketUpdate (forestry.core.network.PacketUpdate)17 ItemStack (net.minecraft.item.ItemStack)4 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 IIndividual (forestry.api.genetics.IIndividual)1 IMailAddress (forestry.api.mail.IMailAddress)1