Search in sources :

Example 11 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project OpenModularTurrets by OpenModularTurretsTeam.

the class TurretBaseContainer method detectAndSendChanges.

@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    DebugHandler.getInstance().setListeners(this.listeners);
    for (IContainerListener listener : this.listeners) {
        if (listener instanceof EntityPlayerMP) {
            NetworkingHandler.INSTANCE.sendTo(new MessageTurretBase(this.tileEntity), (EntityPlayerMP) listener);
        }
    }
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) MessageTurretBase(omtteam.openmodularturrets.network.messages.MessageTurretBase)

Example 12 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project BetterWithAddons by DaedalusGame.

the class ContainerCherryBox method detectAndSendChanges.

@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    Iterator<IContainerListener> it = this.listeners.iterator();
    while (it.hasNext()) {
        IContainerListener craft = it.next();
        if (this.workTime != tileCherryBox.workTime) {
            craft.sendWindowProperty(this, 0, tileCherryBox.workTime);
        }
        if (this.totalWorkTime != tileCherryBox.totalWorkTime) {
            craft.sendWindowProperty(this, 1, tileCherryBox.totalWorkTime);
        }
    }
    this.workTime = tileCherryBox.workTime;
    this.totalWorkTime = tileCherryBox.totalWorkTime;
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Example 13 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project BetterWithAddons by DaedalusGame.

the class ContainerChute method detectAndSendChanges.

@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    for (IContainerListener craft : this.listeners) {
        if (this.lastMechPower != this.tileChute.power)
            craft.sendWindowProperty(this, 0, this.tileChute.power);
    }
    this.lastMechPower = this.tileChute.power;
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener)

Example 14 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project OpenModularTurrets by OpenModularTurretsTeam.

the class ConfigContainer method detectAndSendChanges.

@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    DebugHandler.getInstance().setListeners(this.listeners);
    for (IContainerListener listener : this.listeners) {
        if (listener instanceof EntityPlayerMP) {
            NetworkingHandler.INSTANCE.sendTo(new MessageTurretBase(this.tileEntity), (EntityPlayerMP) listener);
        }
    }
}
Also used : IContainerListener(net.minecraft.inventory.IContainerListener) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) MessageTurretBase(omtteam.openmodularturrets.network.messages.MessageTurretBase)

Example 15 with IContainerListener

use of net.minecraft.inventory.IContainerListener in project Pearcel-Mod by MiningMark48.

the class ContainerPearcelGenerator method detectAndSendChanges.

@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    for (int i = 0; i < this.listeners.size(); i++) {
        IContainerListener icontainerlistener = (IContainerListener) this.listeners.get(i);
        if (this.currentRF != this.te.getField(0)) {
            icontainerlistener.sendProgressBarUpdate(this, 0, this.te.getField(0));
        }
        if (this.maxRF != this.te.getField(1)) {
            icontainerlistener.sendProgressBarUpdate(this, 1, this.te.getField(1));
        }
        if (this.cooldown != this.te.getField(2)) {
            icontainerlistener.sendProgressBarUpdate(this, 2, this.te.getField(2));
        }
        if (this.rfPerTick != this.te.getField(3)) {
            icontainerlistener.sendProgressBarUpdate(this, 3, this.te.getField(3));
        }
    }
    this.currentRF = this.te.getField(0);
    this.maxRF = this.te.getField(1);
    this.cooldown = this.te.getField(2);
    this.rfPerTick = this.te.getField(3);
}
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