Search in sources :

Example 1 with PacketItemConduitFilter

use of crazypants.enderio.conduits.network.PacketItemConduitFilter 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)

Aggregations

DyeColor (com.enderio.core.common.util.DyeColor)1 PacketExtractMode (crazypants.enderio.conduits.network.PacketExtractMode)1 PacketItemConduitFilter (crazypants.enderio.conduits.network.PacketItemConduitFilter)1