Changed Aeternium crafts

This commit is contained in:
Aleksey 2021-01-06 15:34:01 +03:00
parent 2a2641eea3
commit 22b10fe134
15 changed files with 576 additions and 360 deletions

View file

@ -2,10 +2,30 @@ package ru.betterend.interfaces;
import java.util.List;
import ru.betterend.recipe.builders.AnvilSmithingRecipe;
import ru.betterend.recipe.builders.AnvilRecipe;
public interface AnvilScreenHandlerExtended {
public void be_updateCurrentRecipe(AnvilSmithingRecipe recipe);
public AnvilSmithingRecipe be_getCurrentRecipe();
public List<AnvilSmithingRecipe> be_getRecipes();
public void be_updateCurrentRecipe(AnvilRecipe recipe);
public AnvilRecipe be_getCurrentRecipe();
public List<AnvilRecipe> be_getRecipes();
default void be_nextRecipe() {
List<AnvilRecipe> recipes = this.be_getRecipes();
AnvilRecipe current = this.be_getCurrentRecipe();
int i = recipes.indexOf(current) + 1;
if (i >= recipes.size()) {
i = 0;
}
this.be_updateCurrentRecipe(recipes.get(i));
}
default void be_previousRecipe() {
List<AnvilRecipe> recipes = this.be_getRecipes();
AnvilRecipe current = this.be_getCurrentRecipe();
int i = recipes.indexOf(current) - 1;
if (i <= 0) {
i = recipes.size() - 1;
}
this.be_updateCurrentRecipe(recipes.get(i));
}
}