Java Code Examples for codechicken.nei.recipe.GuiRecipe#getRecipePosition()
The following examples show how to use
codechicken.nei.recipe.GuiRecipe#getRecipePosition() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RecipeHandlerBase.java From NEI-Integration with MIT License | 6 votes |
protected boolean transferFluidTank(GuiRecipe guiRecipe, int recipe, boolean usage) { CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe); Point mousepos = GuiDraw.getMousePosition(); Point offset = guiRecipe.getRecipePosition(recipe); Point relMouse = new Point(mousepos.x - (guiRecipe.width - 176) / 2 - offset.x, mousepos.y - (guiRecipe.height - 166) / 2 - offset.y); if (crecipe.getFluidTanks() != null) { for (PositionedFluidTank tank : crecipe.getFluidTanks()) { if (tank.position.contains(relMouse)) { return tank.transfer(usage); } } } return false; }
Example 2
Source File: PneumaticCraftPlugins.java From PneumaticCraft with GNU General Public License v3.0 | 6 votes |
@Override public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe){ // super.handleTooltip(guiRecipe, currenttip, recipe); MultipleInputOutputRecipe r = (MultipleInputOutputRecipe)arecipes.get(recipe); if(GuiContainerManager.shouldShowTooltip(guiRecipe)) { Point mouse = GuiDraw.getMousePosition(); Point offset = guiRecipe.getRecipePosition(recipe); Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y); for(IGuiWidget widget : r.tooltipWidgets) { if(widget.getBounds().contains(relMouse)) { widget.addTooltip(mouse.x, mouse.y, currenttip, false); } } if(r.tempWidget != null) { if(r.tempWidget.getBounds().contains(relMouse)) { r.heatExchanger.setTemperature(r.tempWidget.getScales()[0]); r.tempWidget.addTooltip(mouse.x, mouse.y, currenttip, false); } } } return currenttip; }
Example 3
Source File: RecipeHandlerBase.java From NEI-Integration with MIT License | 5 votes |
@Override public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe) { super.handleTooltip(guiRecipe, currenttip, recipe); CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe); if (GuiContainerManager.shouldShowTooltip(guiRecipe)) { Point mouse = GuiDraw.getMousePosition(); Point offset = guiRecipe.getRecipePosition(recipe); Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y); currenttip = this.provideTooltip(guiRecipe, currenttip, crecipe, relMouse); } return currenttip; }
Example 4
Source File: RecipeHandlerBase.java From NEI-Integration with MIT License | 5 votes |
@Override public List<String> handleItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List<String> currenttip, int recipe) { super.handleItemTooltip(guiRecipe, itemStack, currenttip, recipe); CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe); Point mouse = GuiDraw.getMousePosition(); Point offset = guiRecipe.getRecipePosition(recipe); Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y); currenttip = this.provideItemTooltip(guiRecipe, itemStack, currenttip, crecipe, relMouse); return currenttip; }