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