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);
}
}
}
use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.
the class ContainerLocomotiveSteamSolid method sendUpdateToClient.
@Override
public void sendUpdateToClient() {
super.sendUpdateToClient();
for (IContainerListener listener : listeners) {
if (lastBurnTime != loco.boiler.burnTime)
listener.sendProgressBarUpdate(this, 20, (int) Math.round(loco.boiler.burnTime));
if (lastItemBurnTime != loco.boiler.currentItemBurnTime)
listener.sendProgressBarUpdate(this, 21, (int) Math.round(loco.boiler.currentItemBurnTime));
}
this.lastBurnTime = loco.boiler.burnTime;
this.lastItemBurnTime = loco.boiler.currentItemBurnTime;
}
use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.
the class ContainerBoilerFluid 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();
}
use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.
the class ContainerEnergyLoader method sendUpdateToClient.
/**
* Updates crafting matrix; called from onCraftMatrixChanged. Args: none
*/
@Override
public void sendUpdateToClient() {
super.sendUpdateToClient();
for (IContainerListener listener : listeners) {
if (lastEnergy != device.getEnergy())
PacketBuilder.instance().sendGuiIntegerPacket(listener, windowId, 0, (int) device.getEnergy());
if (lastStorage != device.storageUpgrades)
listener.sendProgressBarUpdate(this, 1, device.storageUpgrades);
if (lastLapotron != device.lapotronUpgrades)
listener.sendProgressBarUpdate(this, 2, device.lapotronUpgrades);
if (lastTransferRate != device.transferRate)
listener.sendProgressBarUpdate(this, 3, device.transferRate);
}
lastEnergy = (int) device.getEnergy();
lastStorage = device.storageUpgrades;
lastLapotron = device.lapotronUpgrades;
lastTransferRate = device.transferRate;
}
use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.
the class ContainerEngineSteam method sendUpdateToClient.
@Override
public void sendUpdateToClient() {
super.sendUpdateToClient();
for (IContainerListener crafter : listeners) {
if (lastOutput != tile.currentOutput)
crafter.sendProgressBarUpdate(this, 14, Math.round(tile.currentOutput * 100));
}
this.lastOutput = tile.currentOutput;
}
Aggregations