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();
}
use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.
the class ContainerBlastFurnace method sendUpdateToClient.
/**
* Updates crafting matrix; called from onCraftMatrixChanged. Args: none
*/
@Override
public void sendUpdateToClient() {
super.sendUpdateToClient();
for (IContainerListener listener : listeners) {
if (lastCookTime != furnace.getCookTime())
listener.sendProgressBarUpdate(this, 0, furnace.getCookTime());
if (lastBurnTime != furnace.burnTime)
PacketBuilder.instance().sendGuiIntegerPacket((EntityPlayerMP) listener, windowId, 1, furnace.burnTime);
if (lastItemBurnTime != furnace.currentItemBurnTime)
PacketBuilder.instance().sendGuiIntegerPacket((EntityPlayerMP) listener, windowId, 2, furnace.currentItemBurnTime);
}
lastCookTime = furnace.getCookTime();
lastBurnTime = furnace.burnTime;
lastItemBurnTime = furnace.currentItemBurnTime;
}
use of net.minecraft.inventory.IContainerListener in project Railcraft by Railcraft.
the class ContainerBoilerSolid 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 ContainerRockCrusher method sendUpdateToClient.
@Override
public void sendUpdateToClient() {
super.sendUpdateToClient();
for (Object crafter : listeners) {
IContainerListener listener = (IContainerListener) crafter;
if (lastProcessTime != tile.getProcessTime())
listener.sendProgressBarUpdate(this, 0, tile.getProcessTime());
}
lastProcessTime = tile.getProcessTime();
}
Aggregations