Search in sources :

Example 16 with IContainerListener

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

the class ContainerRouting method sendUpdateToClient.

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

Example 17 with IContainerListener

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

the class ContainerEngineSteamHobby method sendUpdateToClient.

@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    for (IContainerListener crafter : listeners) {
        if (lastBurnTime != tile.boiler.burnTime)
            crafter.sendProgressBarUpdate(this, 10, (int) Math.round(tile.boiler.burnTime));
        if (lastItemBurnTime != tile.boiler.currentItemBurnTime)
            crafter.sendProgressBarUpdate(this, 11, (int) Math.round(tile.boiler.currentItemBurnTime));
        if (lastOutput != tile.currentOutput)
            crafter.sendProgressBarUpdate(this, 12, Math.round(tile.currentOutput * 100));
    }
    this.lastBurnTime = tile.boiler.burnTime;
    this.lastItemBurnTime = tile.boiler.currentItemBurnTime;
    this.lastOutput = tile.currentOutput;
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Example 18 with IContainerListener

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

the class ContainerBore method sendUpdateToClient.

@Override
public void sendUpdateToClient() {
    super.sendUpdateToClient();
    for (IContainerListener var2 : listeners) {
        if (lastBurnTime != bore.getBurnTime()) {
            var2.sendProgressBarUpdate(this, 0, bore.getBurnTime());
        }
        if (lastFuel != bore.getFuel()) {
            var2.sendProgressBarUpdate(this, 1, bore.getFuel());
        }
    }
    this.lastBurnTime = bore.getBurnTime();
    this.lastFuel = bore.getFuel();
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Example 19 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 20 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)

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