Ejemplo n.º 1
0
  @Override
  public void handleMouseInput() throws IOException {
    super.handleMouseInput();

    int mouseX = Mouse.getEventX() * width / mc.displayWidth;
    int mouseY = height - Mouse.getEventY() * height / mc.displayHeight - 1;
    Slot slot = container.getSlot(0);

    if (isPointInRegion(slot.xPos - 5, slot.yPos - 5, 21, 21, mouseX, mouseY)) {
      int wheel = Mouse.getDWheel();

      if (wheel < 0) {
        actionPerformed(nextButton);
      } else if (wheel > 0) {
        actionPerformed(prevButton);
      }
    }
  }