Changed Aeternium crafts
This commit is contained in:
parent
2a2641eea3
commit
22b10fe134
15 changed files with 576 additions and 360 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue