Search in sources :

Example 6 with IContainerListener

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

the class ContainerCokeOven method sendUpdateToClient.

@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    for (int i = 0; i < listeners.size(); i++) {
        IContainerListener listener = listeners.get(i);
        int cookTime = tile.getCookTime();
        if (lastCookTime != cookTime)
            listener.sendProgressBarUpdate(this, 10, cookTime);
        int cookTimeTotal = tile.getTotalCookTime();
        if (lastCookTimeTotal != cookTimeTotal)
            listener.sendProgressBarUpdate(this, 11, cookTimeTotal);
    }
    lastCookTime = tile.getCookTime();
    lastCookTimeTotal = tile.getTotalCookTime();
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Example 7 with IContainerListener

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

the class ContainerSteamOven method sendUpdateToClient.

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

Example 8 with IContainerListener

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

the class ContainerTrackRouting method sendUpdateToClient.

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

Example 9 with IContainerListener

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

the class ContainerTurbine method sendUpdateToClient.

@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    for (IContainerListener listener : listeners) {
        if (lastOutput != Math.round(tile.output))
            listener.sendProgressBarUpdate(this, 0, Math.round(tile.output));
    }
    lastOutput = Math.round(tile.output);
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Example 10 with IContainerListener

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

the class ContainerWorldspike method sendUpdateToClient.

/**
     * Updates crafting matrix; called from onCraftMatrixChanged. Args: none
     */
@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    short minutes = getMinutesRemaining(worldspike.getFuelAmount());
    for (IContainerListener listener : listeners) {
        if (prevMinutesRemaining != minutes)
            listener.sendProgressBarUpdate(this, 0, minutes);
    }
    this.prevMinutesRemaining = minutes;
}
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