Ejemplo n.º 1
0
  @Override
  public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
    Point point = GuiDraw.getMousePosition();
    Point offset = gui.getRecipePosition(recipe);

    int xAxis =
        point.x
            - (Integer)
                MekanismUtils.getPrivateValue(
                    gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)
            - offset.x;
    int yAxis =
        point.y
            - (Integer)
                MekanismUtils.getPrivateValue(
                    gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)
            - offset.y;

    if (xAxis >= 6 - 5 && xAxis <= 22 - 5 && yAxis >= 11 - 10 && yAxis <= 69 - 10) {
      currenttip.add(
          LangUtils.localizeFluidStack(
              ((CachedIORecipe) arecipes.get(recipe)).pressurizedRecipe.getInput().getFluid()));
    } else if (xAxis >= 29 - 5 && xAxis <= 45 - 5 && yAxis >= 11 - 10 && yAxis <= 69 - 10) {
      currenttip.add(
          LangUtils.localizeGasStack(
              ((CachedIORecipe) arecipes.get(recipe)).pressurizedRecipe.getInput().getGas()));
    } else if (xAxis >= 141 - 5 && xAxis <= 157 - 5 && yAxis >= 41 - 10 && yAxis <= 69 - 10) {
      currenttip.add(
          LangUtils.localizeGasStack(
              ((CachedIORecipe) arecipes.get(recipe))
                  .pressurizedRecipe
                  .getOutput()
                  .getGasOutput()));
    }

    return super.handleTooltip(gui, currenttip, recipe);
  }