Search in sources :

Example 1 with MessageSyncMachineBacklog

use of com.bluepowermod.network.message.MessageSyncMachineBacklog in project BluePower by Qmunity.

the class ContainerMachineBase method detectAndSendChanges.

/**
     * Looks for changes made in the container, sends them to every listener.
     */
@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    for (Object crafter : crafters) {
        ICrafting icrafting = (ICrafting) crafter;
        if (backlogSize != machine.getBacklog().size() && icrafting instanceof EntityPlayerMP) {
            BPNetworkHandler.INSTANCE.sendTo(new MessageSyncMachineBacklog(machine, machine.getBacklog()), (EntityPlayerMP) icrafting);
        }
    }
    backlogSize = machine.getBacklog().size();
}
Also used : ICrafting(net.minecraft.inventory.ICrafting) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) MessageSyncMachineBacklog(com.bluepowermod.network.message.MessageSyncMachineBacklog)

Aggregations

MessageSyncMachineBacklog (com.bluepowermod.network.message.MessageSyncMachineBacklog)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 ICrafting (net.minecraft.inventory.ICrafting)1