Search in sources :

Example 1 with PacketSetLogisticsFilterStack

use of pneumaticCraft.common.network.PacketSetLogisticsFilterStack in project PneumaticCraft by MineMaarten.

the class GuiLogisticsBase method initGui.

@Override
public void initGui() {
    super.initGui();
    if (searchGui != null) {
        inventorySlots.getSlot(editingSlot).putStack(searchGui.getSearchStack());
        NetworkHandler.sendToServer(new PacketSetLogisticsFilterStack(logistics, searchGui.getSearchStack(), editingSlot));
        searchGui = null;
    }
    if (fluidSearchGui != null && fluidSearchGui.getFilter() != null) {
        FluidStack filter = new FluidStack(fluidSearchGui.getFilter(), 1000);
        logistics.setFilter(editingSlot, filter);
        NetworkHandler.sendToServer(new PacketSetLogisticsFluidFilterStack(logistics, filter, editingSlot));
        fluidSearchGui = null;
    }
    String invisibleText = I18n.format("gui.logisticFrame.invisible");
    addWidget(invisible = new GuiCheckBox(9, guiLeft + xSize - 15 - fontRendererObj.getStringWidth(invisibleText), guiTop + 7, 0xFF000000, invisibleText));
    invisible.setTooltip(Arrays.asList(WordUtils.wrap(I18n.format("gui.logisticFrame.invisible.tooltip"), 40).split(System.getProperty("line.separator"))));
    addWidget(new WidgetLabel(guiLeft + 8, guiTop + 18, I18n.format(String.format("gui.%s.filters", SemiBlockManager.getKeyForSemiBlock(logistics)))));
    addWidget(new WidgetLabel(guiLeft + 8, guiTop + 90, I18n.format("gui.logisticFrame.liquid")));
    for (int i = 0; i < 9; i++) {
        addWidget(new WidgetFluidStack(i, guiLeft + i * 18 + 8, guiTop + 101, logistics.getTankFilter(i)));
    }
    addInfoTab(I18n.format("gui.tab.info." + SemiBlockManager.getKeyForSemiBlock(logistics)));
}
Also used : WidgetLabel(pneumaticCraft.client.gui.widget.WidgetLabel) PacketSetLogisticsFilterStack(pneumaticCraft.common.network.PacketSetLogisticsFilterStack) PacketSetLogisticsFluidFilterStack(pneumaticCraft.common.network.PacketSetLogisticsFluidFilterStack) WidgetFluidStack(pneumaticCraft.client.gui.widget.WidgetFluidStack) FluidStack(net.minecraftforge.fluids.FluidStack) WidgetFluidStack(pneumaticCraft.client.gui.widget.WidgetFluidStack) GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox)

Aggregations

FluidStack (net.minecraftforge.fluids.FluidStack)1 GuiCheckBox (pneumaticCraft.client.gui.widget.GuiCheckBox)1 WidgetFluidStack (pneumaticCraft.client.gui.widget.WidgetFluidStack)1 WidgetLabel (pneumaticCraft.client.gui.widget.WidgetLabel)1 PacketSetLogisticsFilterStack (pneumaticCraft.common.network.PacketSetLogisticsFilterStack)1 PacketSetLogisticsFluidFilterStack (pneumaticCraft.common.network.PacketSetLogisticsFluidFilterStack)1