use of forestry.core.gui.widgets.TankWidget in project ForestryMC by ForestryMC.
the class GuiForestry method getFluidStackAtPosition.
@Nullable
public FluidStack getFluidStackAtPosition(int mouseX, int mouseY) {
for (Widget widget : widgetManager.getWidgets()) {
if (widget instanceof TankWidget && widget.isMouseOver(mouseX - guiLeft, mouseY - guiTop)) {
TankWidget tankWidget = (TankWidget) widget;
IFluidTank tank = tankWidget.getTank();
if (tank != null) {
return tank.getFluid();
}
}
}
return null;
}
Aggregations