Search in sources :

Example 1 with IForestryPacketClient

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

the class ContainerMinecartBeehouse method detectAndSendChanges.

@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    int beeProgress = entity.getBeekeepingLogic().getBeeProgressPercent();
    if (this.beeProgress != beeProgress) {
        this.beeProgress = beeProgress;
        IForestryPacketClient packet = new PacketGuiUpdateEntity(entity, entity);
        sendPacketToListeners(packet);
    }
}
Also used : PacketGuiUpdateEntity(forestry.core.network.packets.PacketGuiUpdateEntity) IForestryPacketClient(forestry.core.network.IForestryPacketClient)

Example 2 with IForestryPacketClient

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

the class ContainerAlveary method detectAndSendChanges.

@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    int beeProgress = tile.getBeekeepingLogic().getBeeProgressPercent();
    if (this.beeProgress != beeProgress) {
        this.beeProgress = beeProgress;
        IForestryPacketClient packet = new PacketGuiUpdate(tile);
        sendPacketToListeners(packet);
    }
}
Also used : PacketGuiUpdate(forestry.core.network.packets.PacketGuiUpdate) IForestryPacketClient(forestry.core.network.IForestryPacketClient)

Example 3 with IForestryPacketClient

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

the class TankManager method sendTankUpdate.

private void sendTankUpdate(Container container, Iterable<IContainerListener> crafters, StandardTank tank) {
    if (tile != null) {
        int tankIndex = tank.getTankIndex();
        FluidStack fluid = tank.getFluid();
        IForestryPacketClient packet = new PacketTankLevelUpdate(tile, tankIndex, fluid);
        for (IContainerListener crafter : crafters) {
            if (crafter instanceof EntityPlayerMP) {
                NetworkUtil.sendToPlayer(packet, (EntityPlayerMP) crafter);
            }
        }
        if (fluid == null) {
            prevFluidStacks.remove(container, tankIndex);
        } else {
            prevFluidStacks.put(container, tankIndex, fluid.copy());
        }
    }
}
Also used : FluidStack(net.minecraftforge.fluids.FluidStack) IContainerListener(net.minecraft.inventory.IContainerListener) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) IForestryPacketClient(forestry.core.network.IForestryPacketClient) PacketTankLevelUpdate(forestry.core.network.packets.PacketTankLevelUpdate)

Example 4 with IForestryPacketClient

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

the class ContainerSolderingIron method handleSelectionRequest.

@Override
public void handleSelectionRequest(EntityPlayerMP player, int primary, int secondary) {
    if (secondary == 0) {
        if (primary == 0) {
            inventory.advanceLayout();
        }
    } else if (primary == 0) {
        inventory.regressLayout();
    }
    IForestryPacketClient packetResponse = new PacketGuiLayoutSelect(inventory.getLayout().getUID());
    NetworkUtil.sendToPlayer(packetResponse, player);
}
Also used : IForestryPacketClient(forestry.core.network.IForestryPacketClient) PacketGuiLayoutSelect(forestry.core.network.packets.PacketGuiLayoutSelect)

Example 5 with IForestryPacketClient

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

the class ContainerBeeHousing method detectAndSendChanges.

@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    int beeProgress = tile.getBeekeepingLogic().getBeeProgressPercent();
    if (this.beeProgress != beeProgress) {
        this.beeProgress = beeProgress;
        IForestryPacketClient packet = new PacketGuiUpdate(tile);
        sendPacketToListeners(packet);
    }
}
Also used : PacketGuiUpdate(forestry.core.network.packets.PacketGuiUpdate) IForestryPacketClient(forestry.core.network.IForestryPacketClient)

Aggregations

IForestryPacketClient (forestry.core.network.IForestryPacketClient)5 PacketGuiUpdate (forestry.core.network.packets.PacketGuiUpdate)2 PacketGuiLayoutSelect (forestry.core.network.packets.PacketGuiLayoutSelect)1 PacketGuiUpdateEntity (forestry.core.network.packets.PacketGuiUpdateEntity)1 PacketTankLevelUpdate (forestry.core.network.packets.PacketTankLevelUpdate)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 IContainerListener (net.minecraft.inventory.IContainerListener)1 FluidStack (net.minecraftforge.fluids.FluidStack)1