Search in sources :

Example 1 with IoMode

use of crazypants.enderio.base.machine.modes.IoMode in project EnderIO by SleepyTrousers.

the class GuiMachineBase method renderSlotHighlights.

public void renderSlotHighlights() {
    SelectedFace<T> sel = configOverlay.getSelection();
    if (sel != null) {
        IoMode mode = sel.config.getIoMode(sel.face);
        renderSlotHighlights(mode);
    }
}
Also used : IoMode(crazypants.enderio.base.machine.modes.IoMode)

Example 2 with IoMode

use of crazypants.enderio.base.machine.modes.IoMode in project EnderIO by SleepyTrousers.

the class AbstractMachineEntity method doSideIo.

protected final void doSideIo() {
    if (faceModes == null) {
        return;
    }
    Set<Entry<EnumFacing, IoMode>> ents = faceModes.entrySet();
    for (Entry<EnumFacing, IoMode> ent : ents) {
        IoMode mode = ent.getValue();
        if (mode.pulls()) {
            Prof.start(getWorld(), "pull");
            boolean done = doPull(ent.getKey());
            Prof.stop(getWorld());
            if (done) {
                return;
            }
        }
        if (mode.pushes()) {
            Prof.start(getWorld(), "push");
            boolean done = doPush(ent.getKey());
            Prof.stop(getWorld());
            if (done) {
                return;
            }
        }
    }
}
Also used : Entry(java.util.Map.Entry) EnumFacing(net.minecraft.util.EnumFacing) IoMode(crazypants.enderio.base.machine.modes.IoMode)

Example 3 with IoMode

use of crazypants.enderio.base.machine.modes.IoMode in project EnderIO by SleepyTrousers.

the class LegacyMachineWrapper method computeSlotMappings.

protected void computeSlotMappings() {
    final IoMode ioMode = machine.getIoMode(side);
    if (ioMode != lastIoMode) {
        slots.clear();
        final SlotDefinition slotDefinition = machine.getSlotDefinition();
        for (int i = 0; i < slotDefinition.getNumSlots(); i++) {
            if ((ioMode.canRecieveInput() && slotDefinition.isInputSlot(i)) || ((ioMode.canOutput() && slotDefinition.isOutputSlot(i)))) {
                slots.add(i);
            }
        }
        lastIoMode = ioMode;
    }
}
Also used : SlotDefinition(crazypants.enderio.base.machine.baselegacy.SlotDefinition) IoMode(crazypants.enderio.base.machine.modes.IoMode)

Example 4 with IoMode

use of crazypants.enderio.base.machine.modes.IoMode in project EnderIO by SleepyTrousers.

the class TileCapBank method updateReceptors.

private void updateReceptors() {
    if (network == null) {
        return;
    }
    network.removeReceptors(receptors);
    receptors.clear();
    for (EnumFacing dir : EnumFacing.values()) {
        IPowerInterface pi = getReceptorForFace(NullHelper.notnullJ(dir, "Enum.values()"));
        if (pi != null) {
            IoMode ioMode = getIoMode(NullHelper.notnullJ(dir, "Enum.values()"));
            if (ioMode != IoMode.DISABLED && ioMode != IoMode.PULL) {
                EnergyReceptor er = new EnergyReceptor(this, pi, NullHelper.notnullJ(dir, "Enum.values()"));
                validateModeForReceptor(er);
                receptors.add(er);
            }
        }
    }
    network.addReceptors(receptors);
    receptorsDirty = false;
}
Also used : EnergyReceptor(crazypants.enderio.powertools.machine.capbank.network.EnergyReceptor) EnumFacing(net.minecraft.util.EnumFacing) IPowerInterface(crazypants.enderio.base.power.IPowerInterface) IoMode(crazypants.enderio.base.machine.modes.IoMode)

Example 5 with IoMode

use of crazypants.enderio.base.machine.modes.IoMode in project EnderIO by SleepyTrousers.

the class InvPanelRenderMapper method renderIO.

@Override
@SideOnly(Side.CLIENT)
protected EnumMap<EnumFacing, EnumIOMode> renderIO(@Nonnull AbstractMachineEntity tileEntity, @Nonnull AbstractMachineBlock<?> block) {
    EnumMap<EnumFacing, EnumIOMode> result = new EnumMap<EnumFacing, EnumIOMode>(EnumFacing.class);
    EnumFacing face = tileEntity.getFacing().getOpposite();
    IoMode ioMode = tileEntity.getIoMode(face);
    if (ioMode != IoMode.NONE) {
        result.put(face, block.mapIOMode(ioMode, face));
        return result;
    }
    return null;
}
Also used : EnumFacing(net.minecraft.util.EnumFacing) EnumIOMode(crazypants.enderio.base.render.property.IOMode.EnumIOMode) IoMode(crazypants.enderio.base.machine.modes.IoMode) EnumMap(java.util.EnumMap) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

IoMode (crazypants.enderio.base.machine.modes.IoMode)16 EnumFacing (net.minecraft.util.EnumFacing)8 EnumIOMode (crazypants.enderio.base.render.property.IOMode.EnumIOMode)4 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)4 EnumMap (java.util.EnumMap)3 Nonnull (javax.annotation.Nonnull)3 IPowerInterface (crazypants.enderio.base.power.IPowerInterface)2 Rectangle (java.awt.Rectangle)2 IBlockState (net.minecraft.block.state.IBlockState)2 IFluidWrapper (com.enderio.core.common.fluid.IFluidWrapper)1 Vector4f (com.enderio.core.common.vecmath.Vector4f)1 IConduitBundle (crazypants.enderio.base.conduit.IConduitBundle)1 SlotDefinition (crazypants.enderio.base.machine.baselegacy.SlotDefinition)1 PacketIoMode (crazypants.enderio.base.machine.modes.PacketIoMode)1 BlockCapBank (crazypants.enderio.powertools.machine.capbank.BlockCapBank)1 InfoDisplayType (crazypants.enderio.powertools.machine.capbank.InfoDisplayType)1 TileCapBank (crazypants.enderio.powertools.machine.capbank.TileCapBank)1 EnergyReceptor (crazypants.enderio.powertools.machine.capbank.network.EnergyReceptor)1 ArrayList (java.util.ArrayList)1 Entry (java.util.Map.Entry)1