Search in sources :

Example 1 with BookElement

use of slimeknights.mantle.client.screen.book.element.BookElement in project TinkersConstruct by SlimeKnights.

the class ContentModifier method nextRecipe.

/**
 * Cycles to the next recipe by deleting the old elements and adding them again.
 *
 * @param book The book data
 * @param list The list of book elements
 */
public void nextRecipe(BookData book, ArrayList<BookElement> list) {
    this.currentRecipe++;
    if (this.currentRecipe >= this.recipes.size()) {
        this.currentRecipe = 0;
    }
    BookScreen parent = this.parts.get(0).parent;
    for (BookElement element : this.parts) {
        list.remove(element);
    }
    this.parts.clear();
    this.buildAndAddRecipeDisplay(book, list, this.recipes.get(this.currentRecipe), parent);
}
Also used : BookElement(slimeknights.mantle.client.screen.book.element.BookElement) BookScreen(slimeknights.mantle.client.screen.book.BookScreen)

Aggregations

BookScreen (slimeknights.mantle.client.screen.book.BookScreen)1 BookElement (slimeknights.mantle.client.screen.book.element.BookElement)1