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();
}
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;
}
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();
}
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();
}
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();
}
Aggregations