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;
}
Aggregations