@Override
  public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
    Point point = GuiDraw.getMousePosition();

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

    if (xAxis >= 6 && xAxis <= 22 && yAxis >= 11 + 7 && yAxis <= 69 + 7) {
      currenttip.add(
          LangUtils.localizeFluidStack(
              ((CachedIORecipe) arecipes.get(recipe)).fluidInput.ingredient));
    } else if (xAxis >= 59 && xAxis <= 75 && yAxis >= 19 + 7 && yAxis <= 47 + 7) {
      currenttip.add(
          ((CachedIORecipe) arecipes.get(recipe)).outputPair.leftGas.getGas().getLocalizedName());
    } else if (xAxis >= 101 && xAxis <= 117 && yAxis >= 19 + 7 && yAxis <= 47 + 7) {
      currenttip.add(
          ((CachedIORecipe) arecipes.get(recipe)).outputPair.rightGas.getGas().getLocalizedName());
    }

    return super.handleTooltip(gui, currenttip, recipe);
  }
Ejemplo n.º 2
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);
  }