Exemplo n.º 1
0
  public CraftTypeDisplay(
      int x,
      int y,
      int width,
      int height,
      GuiScrollBar scrollBar,
      Texture texture,
      RecipeCache recipeCache) {
    super(x, y, width, height, scrollBar, 32, 1);

    displayBackground = new BorderedTexture(texture, 117, 1, 1, 32, 2);

    this.recipeCache = recipeCache;
    recipeCache.addListener(this);
    initTypes(recipeCache);

    buttons[0] = new TexturedRect(0, 0, 28, 28, texture, 113, 76);
    buttons[1] = new TexturedRect(0, 0, 28, 28, texture, 113, 104);
    buttons[2] = new TexturedRect(0, 0, 28, 28, texture, 113, 132);
    buttons[3] = new TexturedRect(0, 0, 28, 28, texture, 141, 76);
    buttons[4] = new TexturedRect(0, 0, 28, 28, texture, 141, 104);
    buttons[5] = new TexturedRect(0, 0, 28, 28, texture, 141, 132);

    setRows(recipeCache.getCraftTypes().size());
    setCells(recipeCache.getCraftTypes().size());
  }