Search in sources :

Example 21 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.

the class ContainerCartEnergy method sendUpdateToClient.

/**
     * Updates crafting matrix; called from onCraftMatrixChanged. Args: none
     */
@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    for (IContainerListener player : listeners) {
        if (lastEnergy != cart.getEnergy())
            PacketBuilder.instance().sendGuiIntegerPacket(player, windowId, 0, (int) cart.getEnergy());
    }
    lastEnergy = (int) cart.getEnergy();
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Example 22 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.

the class ContainerAspectAction method sendUpdateToClient.

@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    for (IContainerListener crafter : listeners) {
        int lock = actionManager.getLockController().getCurrentState();
        if (lastLockState != lock)
            crafter.sendProgressBarUpdate(this, 0, lock);
    }
    this.lastLockState = actionManager.getLockController().getCurrentState();
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Example 23 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.

the class ContainerBlastFurnace method sendUpdateToClient.

/**
     * Updates crafting matrix; called from onCraftMatrixChanged. Args: none
     */
@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    for (IContainerListener listener : listeners) {
        if (lastCookTime != furnace.getCookTime())
            listener.sendProgressBarUpdate(this, 0, furnace.getCookTime());
        if (lastBurnTime != furnace.burnTime)
            PacketBuilder.instance().sendGuiIntegerPacket((EntityPlayerMP) listener, windowId, 1, furnace.burnTime);
        if (lastItemBurnTime != furnace.currentItemBurnTime)
            PacketBuilder.instance().sendGuiIntegerPacket((EntityPlayerMP) listener, windowId, 2, furnace.currentItemBurnTime);
    }
    lastCookTime = furnace.getCookTime();
    lastBurnTime = furnace.burnTime;
    lastItemBurnTime = furnace.currentItemBurnTime;
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP)

Example 24 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.

the class ContainerBoilerSolid method sendUpdateToClient.

@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    for (IContainerListener listener : listeners) {
        if (lastBurnTime != tile.boiler.burnTime)
            listener.sendProgressBarUpdate(this, 10, (int) Math.round(tile.boiler.burnTime));
        if (lastItemBurnTime != tile.boiler.currentItemBurnTime)
            listener.sendProgressBarUpdate(this, 11, (int) Math.round(tile.boiler.currentItemBurnTime));
        if (wasBurning != tile.boiler.isBurning())
            listener.sendProgressBarUpdate(this, 13, tile.boiler.isBurning() ? 1 : 0);
    }
    this.lastBurnTime = tile.boiler.burnTime;
    this.lastItemBurnTime = tile.boiler.currentItemBurnTime;
    this.wasBurning = tile.boiler.isBurning();
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Example 25 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.

the class ContainerRockCrusher method sendUpdateToClient.

@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    for (Object crafter : listeners) {
        IContainerListener listener = (IContainerListener) crafter;
        if (lastProcessTime != tile.getProcessTime())
            listener.sendProgressBarUpdate(this, 0, tile.getProcessTime());
    }
    lastProcessTime = tile.getProcessTime();
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Aggregations

IContainerListener (net.minecraft.inventory.IContainerListener)25 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)3 MessageTurretBase (omtteam.openmodularturrets.network.messages.MessageTurretBase)2 LocoMode (mods.railcraft.common.carts.EntityLocomotive.LocoMode)1 LocoSpeed (mods.railcraft.common.carts.EntityLocomotive.LocoSpeed)1