Search in sources :

Example 1 with IGhostIngredientTarget

use of gregtech.api.gui.igredient.IGhostIngredientTarget in project GregTech by GregTechCE.

the class ModularUIGuiHandler method getTargets.

@Override
public <I> List<Target<I>> getTargets(ModularUIGui gui, I ingredient, boolean doStart) {
    Collection<Widget> widgets = gui.getModularUI().guiWidgets.values();
    List<Target<I>> targets = new ArrayList<>();
    for (Widget widget : widgets) {
        if (widget instanceof IGhostIngredientTarget) {
            IGhostIngredientTarget ghostTarget = (IGhostIngredientTarget) widget;
            List<Target<?>> widgetTargets = ghostTarget.getPhantomTargets(ingredient);
            // noinspection unchecked
            targets.addAll((List<Target<I>>) (Object) widgetTargets);
        }
    }
    return targets;
}
Also used : IGhostIngredientTarget(gregtech.api.gui.igredient.IGhostIngredientTarget) Widget(gregtech.api.gui.Widget) IRecipeTransferHandlerWidget(gregtech.api.gui.igredient.IRecipeTransferHandlerWidget) IGhostIngredientTarget(gregtech.api.gui.igredient.IGhostIngredientTarget)

Aggregations

Widget (gregtech.api.gui.Widget)1 IGhostIngredientTarget (gregtech.api.gui.igredient.IGhostIngredientTarget)1 IRecipeTransferHandlerWidget (gregtech.api.gui.igredient.IRecipeTransferHandlerWidget)1