Ejemplo n.º 1
0
 @Override
 public List<String> handleItemTooltip(
     GuiRecipe gui, ItemStack stack, List<String> currenttip, int recipe) {
   if (stack != null) {
     for (PositionedStack is : ((CentrifugeRecipe) arecipes.get(recipe)).getOtherStacks()) {
       if (is instanceof PositionedStackWithTooltip && gui.isMouseOver(is, recipe))
         currenttip.add(((PositionedStackWithTooltip) is).tooltip);
     }
   }
   return super.handleTooltip(gui, currenttip, recipe);
 }
Ejemplo n.º 2
0
  @Override
  public boolean mouseClicked(GuiRecipe gui, int button, 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;

    GasStack gas = null;
    FluidStack fluid = null;

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

    if (gas != null) {
      if (button == 0) {
        if (doGasLookup(gas, false)) {
          return true;
        }
      } else if (button == 1) {
        if (doGasLookup(gas, true)) {
          return true;
        }
      }
    } else if (fluid != null) {
      if (button == 0) {
        if (doFluidLookup(fluid, false)) {
          return true;
        }
      } else if (button == 1) {
        if (doFluidLookup(fluid, true)) {
          return true;
        }
      }
    }

    return super.mouseClicked(gui, button, recipe);
  }
Ejemplo n.º 3
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);
  }