mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-12 00:17:51 +00:00
Add the ability to create a chain of items with zero (#682)
This commit is contained in:
1 parent
95274339a0
commit
4e11a45852
7 files changed
+49
-31
No files matched your search
@@ -207,11 +207,11 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean addRecipe(Recipe recipe, int groupId) {
|
||||
public boolean addRecipe(Recipe recipe, int multiplier, int groupId) {
|
||||
final RecipeId recipeId = recipe.getRecipeId();
|
||||
|
||||
if (recipe != null && this.grid.getGroup(groupId) != null && !this.grid.existsRecipe(recipeId, groupId)) {
|
||||
this.grid.addRecipe(recipe, groupId);
|
||||
this.grid.addRecipe(recipe, multiplier, groupId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
if (item instanceof Recipe recipe) {
|
||||
|
||||
if (uniqueRecipe.add(recipe.getRecipeId())) {
|
||||
this.grid.addRecipe(recipe, groupId);
|
||||
this.grid.addRecipe(recipe, 1, groupId);
|
||||
}
|
||||
|
||||
} else if (item instanceof RecipeId recipeId) {
|
||||
@@ -1202,7 +1202,10 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
&& !handlerName.isEmpty()
|
||||
&& ingredients != null
|
||||
&& !ingredients.isEmpty()) {
|
||||
addRecipe(Recipe.of(Arrays.asList(stack), handlerName, ingredients), BookmarkGrid.DEFAULT_GROUP_ID);
|
||||
addRecipe(
|
||||
Recipe.of(Arrays.asList(stack), handlerName, ingredients),
|
||||
saveSize ? 1 : 0,
|
||||
BookmarkGrid.DEFAULT_GROUP_ID);
|
||||
} else {
|
||||
addItem(stack, saveSize);
|
||||
}
|
||||
@@ -1216,7 +1219,7 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
|
||||
@Deprecated
|
||||
public void addRecipe(BookmarkRecipe recipe, boolean saveSize, int groupId) {
|
||||
addRecipe(recipe.getRecipe(), groupId);
|
||||
addRecipe(recipe.getRecipe(), saveSize ? 1 : 0, groupId);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
Reference in new issue
Block a user