Search in sources :

Example 1 with GuiInventorySearcher

use of pneumaticCraft.client.gui.GuiInventorySearcher in project PneumaticCraft by MineMaarten.

the class GuiProgWidgetCoordinate method actionPerformed.

@Override
public void actionPerformed(GuiButton button) {
    if (button.id == 0) {
        invSearchGui = new GuiInventorySearcher(FMLClientHandler.instance().getClient().thePlayer);
        ChunkPosition area = widget.getRawCoordinate();
        ItemStack gps = new ItemStack(Itemss.GPSTool);
        ItemGPSTool.setGPSLocation(gps, area.chunkPosX, area.chunkPosY, area.chunkPosZ);
        invSearchGui.setSearchStack(ItemGPSTool.getGPSLocation(gps) != null ? gps : null);
        FMLClientHandler.instance().showGuiScreen(invSearchGui);
    }
    super.actionPerformed(button);
}
Also used : ChunkPosition(net.minecraft.world.ChunkPosition) GuiInventorySearcher(pneumaticCraft.client.gui.GuiInventorySearcher) ItemStack(net.minecraft.item.ItemStack)

Example 2 with GuiInventorySearcher

use of pneumaticCraft.client.gui.GuiInventorySearcher in project PneumaticCraft by MineMaarten.

the class GuiProgWidgetArea method actionPerformed.

@Override
public void actionPerformed(GuiButton button) {
    if (button.id == 0 || button.id == 1) {
        invSearchGui = new GuiInventorySearcher(FMLClientHandler.instance().getClient().thePlayer);
        ItemStack gps = new ItemStack(Itemss.GPSTool);
        if (button.id == 0) {
            ItemGPSTool.setGPSLocation(gps, widget.x1, widget.y1, widget.z1);
        } else {
            ItemGPSTool.setGPSLocation(gps, widget.x2, widget.y2, widget.z2);
        }
        invSearchGui.setSearchStack(ItemGPSTool.getGPSLocation(gps) != null ? gps : null);
        FMLClientHandler.instance().showGuiScreen(invSearchGui);
        pointSearched = button.id;
    }
    super.actionPerformed(button);
}
Also used : GuiInventorySearcher(pneumaticCraft.client.gui.GuiInventorySearcher) ItemStack(net.minecraft.item.ItemStack)

Example 3 with GuiInventorySearcher

use of pneumaticCraft.client.gui.GuiInventorySearcher in project PneumaticCraft by MineMaarten.

the class GuiProgWidgetItemFilter method actionPerformed.

@Override
public void actionPerformed(GuiButton button) {
    if (button.id == 0) {
        searchGui = new GuiSearcher(FMLClientHandler.instance().getClient().thePlayer);
        searchGui.setSearchStack(widg.getFilter());
        FMLClientHandler.instance().showGuiScreen(searchGui);
    } else if (button.id == 1) {
        invSearchGui = new GuiInventorySearcher(FMLClientHandler.instance().getClient().thePlayer);
        invSearchGui.setSearchStack(widg.getFilter());
        FMLClientHandler.instance().showGuiScreen(invSearchGui);
    } else if (button.id == 2) {
        if (--widg.specificMeta < 0)
            widg.specificMeta = 15;
    } else if (button.id == 3) {
        if (++widg.specificMeta > 15)
            widg.specificMeta = 0;
    }
    super.actionPerformed(button);
}
Also used : GuiSearcher(pneumaticCraft.client.gui.GuiSearcher) GuiInventorySearcher(pneumaticCraft.client.gui.GuiInventorySearcher)

Aggregations

GuiInventorySearcher (pneumaticCraft.client.gui.GuiInventorySearcher)3 ItemStack (net.minecraft.item.ItemStack)2 ChunkPosition (net.minecraft.world.ChunkPosition)1 GuiSearcher (pneumaticCraft.client.gui.GuiSearcher)1