Search in sources :

Example 1 with PacketExtractMode

use of crazypants.enderio.conduits.network.PacketExtractMode in project EnderIO by SleepyTrousers.

the class ConduitRedstoneModeControlable method setRedstoneControlMode.

@Override
public void setRedstoneControlMode(@Nonnull RedstoneControlMode mode) {
    RedstoneControlMode curMode = getRedstoneControlMode();
    con.setExtractionRedstoneMode(mode, gui.getDir());
    colorB.onGuiInit();
    colorB.setColorIndex(con.getExtractionSignalColor(gui.getDir()).ordinal());
    if (mode == RedstoneControlMode.OFF || mode == RedstoneControlMode.ON) {
        colorB.setIsVisible(true);
    } else {
        colorB.setIsVisible(false);
    }
    if (curMode != mode) {
        PacketHandler.INSTANCE.sendToServer(new PacketExtractMode(con, gui.getDir()));
    }
}
Also used : PacketExtractMode(crazypants.enderio.conduits.network.PacketExtractMode) RedstoneControlMode(crazypants.enderio.base.machine.modes.RedstoneControlMode)

Example 2 with PacketExtractMode

use of crazypants.enderio.conduits.network.PacketExtractMode in project EnderIO by SleepyTrousers.

the class ItemSettings method connectionModeChanged.

@Override
protected void connectionModeChanged(@Nonnull ConnectionMode mode) {
    super.connectionModeChanged(mode);
    PacketHandler.INSTANCE.sendToServer(new PacketExtractMode(itemConduit, gui.getDir()));
    updateGuiVisibility();
}
Also used : PacketExtractMode(crazypants.enderio.conduits.network.PacketExtractMode)

Example 3 with PacketExtractMode

use of crazypants.enderio.conduits.network.PacketExtractMode in project EnderIO by SleepyTrousers.

the class ItemSettings method actionPerformed.

@Override
public void actionPerformed(@Nonnull GuiButton guiButton) {
    super.actionPerformed(guiButton);
    if (guiButton.id == ID_COLOR_BUTTON) {
        itemConduit.setExtractionSignalColor(gui.getDir(), DyeColor.fromIndex(colorB.getColorIndex()));
        PacketHandler.INSTANCE.sendToServer(new PacketExtractMode(itemConduit, gui.getDir()));
        return;
    } else if (guiButton.id == ID_LOOP) {
        itemConduit.setSelfFeedEnabled(gui.getDir(), !itemConduit.isSelfFeedEnabled(gui.getDir()));
    } else if (guiButton.id == ID_ROUND_ROBIN) {
        itemConduit.setRoundRobinEnabled(gui.getDir(), !itemConduit.isRoundRobinEnabled(gui.getDir()));
    } else if (guiButton.id == ID_PRIORITY_UP) {
        itemConduit.setOutputPriority(gui.getDir(), itemConduit.getOutputPriority(gui.getDir()) + 1);
    } else if (guiButton.id == ID_PRIORITY_DOWN) {
        itemConduit.setOutputPriority(gui.getDir(), itemConduit.getOutputPriority(gui.getDir()) - 1);
    } else if (guiButton.id == ID_INSERT_CHANNEL) {
        DyeColor col = DyeColor.values()[insertChannelB.getColorIndex()];
        itemConduit.setOutputColor(gui.getDir(), col);
    } else if (guiButton.id == ID_EXTRACT_CHANNEL) {
        DyeColor col = DyeColor.values()[extractChannelB.getColorIndex()];
        itemConduit.setInputColor(gui.getDir(), col);
    } else if (guiButton.id == ID_INSERT_FILTER_OPTIONS) {
        doOpenFilterGui(FilterGuiUtil.INDEX_OUTPUT);
        return;
    } else if (guiButton.id == ID_EXTRACT_FILTER_OPTIONS) {
        doOpenFilterGui(FilterGuiUtil.INDEX_INPUT);
        return;
    }
    PacketHandler.INSTANCE.sendToServer(new PacketItemConduitFilter(itemConduit, gui.getDir()));
}
Also used : PacketItemConduitFilter(crazypants.enderio.conduits.network.PacketItemConduitFilter) PacketExtractMode(crazypants.enderio.conduits.network.PacketExtractMode) DyeColor(com.enderio.core.common.util.DyeColor)

Example 4 with PacketExtractMode

use of crazypants.enderio.conduits.network.PacketExtractMode in project EnderIO by SleepyTrousers.

the class LiquidSettings method actionPerformed.

@Override
public void actionPerformed(@Nonnull GuiButton guiButton) {
    super.actionPerformed(guiButton);
    if (guiButton.id == ID_COLOR_BUTTON) {
        conduit.setExtractionSignalColor(gui.getDir(), DyeColor.fromIndex(colorB.getColorIndex()));
        PacketHandler.INSTANCE.sendToServer(new PacketExtractMode(conduit, gui.getDir()));
    } else if (guiButton.id == ID_INSERT_WHITELIST) {
        toggleBlacklist(false);
    } else if (guiButton.id == ID_EXTRACT_WHITELIST) {
        toggleBlacklist(true);
    }
}
Also used : PacketExtractMode(crazypants.enderio.conduits.network.PacketExtractMode)

Example 5 with PacketExtractMode

use of crazypants.enderio.conduits.network.PacketExtractMode in project EnderIO by SleepyTrousers.

the class PowerSettings method actionPerformed.

@Override
public void actionPerformed(@Nonnull GuiButton guiButton) {
    super.actionPerformed(guiButton);
    if (guiButton.id == ID_COLOR_BUTTON) {
        conduit.setExtractionSignalColor(gui.getDir(), DyeColor.fromIndex(colorB.getColorIndex()));
        PacketHandler.INSTANCE.sendToServer(new PacketExtractMode(conduit, gui.getDir()));
    }
}
Also used : PacketExtractMode(crazypants.enderio.conduits.network.PacketExtractMode)

Aggregations

PacketExtractMode (crazypants.enderio.conduits.network.PacketExtractMode)5 DyeColor (com.enderio.core.common.util.DyeColor)1 RedstoneControlMode (crazypants.enderio.base.machine.modes.RedstoneControlMode)1 PacketItemConduitFilter (crazypants.enderio.conduits.network.PacketItemConduitFilter)1