Search in sources :

Example 1 with ICrafting

use of net.minecraft.inventory.ICrafting in project BluePower by Qmunity.

the class ContainerAlloyFurnace 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 (currentBurnTime != tileFurnace.currentBurnTime) {
            icrafting.sendProgressBarUpdate(this, 0, tileFurnace.currentBurnTime);
        }
        if (maxBurnTime != tileFurnace.maxBurnTime) {
            icrafting.sendProgressBarUpdate(this, 1, tileFurnace.maxBurnTime);
        }
        if (currentProcessTime != tileFurnace.currentProcessTime) {
            icrafting.sendProgressBarUpdate(this, 2, tileFurnace.currentProcessTime);
        }
    }
    currentBurnTime = tileFurnace.currentBurnTime;
    maxBurnTime = tileFurnace.maxBurnTime;
    currentProcessTime = tileFurnace.currentProcessTime;
}
Also used : ICrafting(net.minecraft.inventory.ICrafting)

Example 2 with ICrafting

use of net.minecraft.inventory.ICrafting in project BluePower by Qmunity.

the class ContainerManager 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 (filterColor != tileManager.filterColor.ordinal()) {
            icrafting.sendProgressBarUpdate(this, 0, tileManager.filterColor.ordinal());
        }
        if (priority != tileManager.priority) {
            icrafting.sendProgressBarUpdate(this, 1, tileManager.priority);
        }
        if (mode != tileManager.mode) {
            icrafting.sendProgressBarUpdate(this, 2, tileManager.mode);
        }
        if (fuzzySetting != tileManager.fuzzySetting) {
            icrafting.sendProgressBarUpdate(this, 3, tileManager.fuzzySetting);
        }
    }
    filterColor = tileManager.filterColor.ordinal();
    priority = tileManager.priority;
    mode = tileManager.mode;
    fuzzySetting = tileManager.fuzzySetting;
}
Also used : ICrafting(net.minecraft.inventory.ICrafting)

Example 3 with ICrafting

use of net.minecraft.inventory.ICrafting in project BluePower by Qmunity.

the class ContainerRetriever 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 (slotIndex != retriever.slotIndex) {
            icrafting.sendProgressBarUpdate(this, 2, retriever.slotIndex);
        }
        if (mode != retriever.mode) {
            icrafting.sendProgressBarUpdate(this, 3, retriever.mode);
        }
    }
    slotIndex = retriever.slotIndex;
    mode = retriever.mode;
}
Also used : ICrafting(net.minecraft.inventory.ICrafting)

Example 4 with ICrafting

use of net.minecraft.inventory.ICrafting in project BluePower by Qmunity.

the class ContainerItemDetector 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 (mode != itemDetector.mode) {
            icrafting.sendProgressBarUpdate(this, 0, itemDetector.mode);
        }
        if (fuzzySetting != itemDetector.fuzzySetting) {
            icrafting.sendProgressBarUpdate(this, 1, itemDetector.fuzzySetting);
        }
    }
    mode = itemDetector.mode;
    fuzzySetting = itemDetector.fuzzySetting;
}
Also used : ICrafting(net.minecraft.inventory.ICrafting)

Example 5 with ICrafting

use of net.minecraft.inventory.ICrafting 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

ICrafting (net.minecraft.inventory.ICrafting)12 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2 MessageSyncMachineBacklog (com.bluepowermod.network.message.MessageSyncMachineBacklog)1 BitSet (java.util.BitSet)1 IFuzzySlot (logisticspipes.interfaces.IFuzzySlot)1 FuzzySlotSettingsPacket (logisticspipes.network.packets.gui.FuzzySlotSettingsPacket)1 Slot (net.minecraft.inventory.Slot)1 ItemStack (net.minecraft.item.ItemStack)1 ILiquidTank (net.minecraftforge.liquids.ILiquidTank)1 LiquidStack (net.minecraftforge.liquids.LiquidStack)1