use of me.desht.pneumaticcraft.client.gui.GuiInventorySearcher in project pnc-repressurized by TeamPneumatic.
the class GuiProgWidgetArea method actionPerformed.
@Override
public void actionPerformed(GuiButton button) throws IOException {
if (button.id == 0 || button.id == 1) {
invSearchGui = new GuiInventorySearcher(FMLClientHandler.instance().getClient().player);
invSearchGui.setStackPredicate(itemStack -> itemStack.getItem() instanceof IPositionProvider);
ItemStack gps = new ItemStack(Itemss.GPS_TOOL);
if (button.id == 0) {
ItemGPSTool.setGPSLocation(gps, new BlockPos(widget.x1, widget.y1, widget.z1));
} else {
ItemGPSTool.setGPSLocation(gps, new BlockPos(widget.x2, widget.y2, widget.z2));
}
invSearchGui.setSearchStack(ItemGPSTool.getGPSLocation(gps) != null ? gps : ItemStack.EMPTY);
FMLClientHandler.instance().showGuiScreen(invSearchGui);
pointSearched = button.id;
}
if (button.id == 1000) {
// When the area is going to be displayed.
saveWidgets();
}
super.actionPerformed(button);
}
use of me.desht.pneumaticcraft.client.gui.GuiInventorySearcher in project pnc-repressurized by TeamPneumatic.
the class GuiProgWidgetCoordinate method actionPerformed.
@Override
public void actionPerformed(GuiButton button) throws IOException {
if (button.id == 0) {
invSearchGui = new GuiInventorySearcher(FMLClientHandler.instance().getClient().player);
invSearchGui.setStackPredicate(itemStack -> itemStack.getItem() instanceof IPositionProvider);
BlockPos area = widget.getRawCoordinate();
ItemStack gps = new ItemStack(Itemss.GPS_TOOL);
ItemGPSTool.setGPSLocation(gps, area);
invSearchGui.setSearchStack(ItemGPSTool.getGPSLocation(gps) != null ? gps : ItemStack.EMPTY);
FMLClientHandler.instance().showGuiScreen(invSearchGui);
}
super.actionPerformed(button);
}
use of me.desht.pneumaticcraft.client.gui.GuiInventorySearcher in project pnc-repressurized by TeamPneumatic.
the class GuiProgWidgetItemFilter method actionPerformed.
@Override
public void actionPerformed(GuiButton button) throws IOException {
if (button.id == 0) {
searchGui = new GuiSearcher(FMLClientHandler.instance().getClient().player);
searchGui.setSearchStack(widg.getFilter());
FMLClientHandler.instance().showGuiScreen(searchGui);
} else if (button.id == 1) {
invSearchGui = new GuiInventorySearcher(FMLClientHandler.instance().getClient().player);
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);
}
Aggregations