Beispiel #1
0
  @Override
  protected void render(boolean isTranslatable) {
    int yPos = 4;
    yPos += drawCenteredString(Lang.translate("Contents"), yPos);
    yPos += drawBlankLine() * 2;
    for (int i = 0; i < pages.size(); i++) {
      String pageTxt = Lang.translate("Page") + " " + pages.get(i);
      int x = PAGE_WIDTH - 4 - getStringWidth(pageTxt);

      int mY = drawTextLine(pageTxt, x, yPos);
      mY = Math.max(mY, drawTextBlock(contents.get(i), 4, yPos, x - 12));

      int s = 0;
      List<String> splitStr = manual.fonts.listFormattedStringToWidth(contents.get(i), x - 12);
      int BORDER = 2;
      for (String s1 : splitStr) {
        s = Math.max(s, BORDER + getStringWidth(s1));
      }

      int pw = manual.fonts.getStringWidth(".");
      if (s + pw < (x - BORDER)) {
        for (int nx = s; nx < (x - BORDER); nx += pw) {
          manual.fonts.drawString(".", nx, yPos, 0);
        }
      }
      yPos += mY;
    }
  }
  public ItemIngredient(String... items) {
    this.items = items;
    this.setMaxDamage(0);
    this.setHasSubtypes(true);

    if (TinkersTailor.deobf_folder) {
      for (int i = 0; i < items.length; i++) {
        Lang.translate(
            this.getUnlocalizedNameInefficiently(new ItemStack(this, 1, i)) + ".name",
            StringHelper.capFirst(items[i]));
      }
    }
  }