mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-19 11:59:17 +00:00
NEI Bookmarks improvements (#188)
* Add bookmarks sets; save items count in bookmarks; change counts in bookmarks; save ingredients in bookmarks; fill fluidcontainers in bookmarks; * change fill container controls * fix fill container * rollback public variables Co-authored-by: Serghei Borovetchi <[email protected]>
This commit is contained in:
1 parent
ce17ec8026
commit
5dde7cad8b
20 files changed
+1582
-591
No files matched your search
@@ -5,9 +5,12 @@ import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.guihook.IContainerInputHandler;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeItemInputHandler implements IContainerInputHandler
|
||||
{
|
||||
@Override
|
||||
@@ -23,14 +26,17 @@ public class RecipeItemInputHandler implements IContainerInputHandler
|
||||
if(keyCode == NEIClientConfig.getKeyBinding("gui.usage"))
|
||||
return GuiUsageRecipe.openRecipeGui("item", stackover.copy());
|
||||
|
||||
if(keyCode == NEIClientConfig.getKeyBinding("gui.bookmark")) {
|
||||
if (keyCode == NEIClientConfig.getKeyBinding("gui.bookmark")) {
|
||||
NEIClientConfig.logger.debug("Adding or removing {} from bookmarks", stackover.getDisplayName());
|
||||
BookmarkRecipeId recipeId = null;
|
||||
List<PositionedStack> ingredients = null;
|
||||
String handlerName = "";
|
||||
|
||||
if (gui instanceof GuiRecipe && NEIClientConfig.saveCurrentRecipeInBookmarksEnabled())
|
||||
recipeId = ((GuiRecipe)gui).getFocusedRecipeId();
|
||||
if (gui instanceof GuiRecipe && NEIClientConfig.saveCurrentRecipeInBookmarksEnabled()) {
|
||||
ingredients = ((GuiRecipe) gui).getFocusedRecipeIngredients();
|
||||
handlerName = ((GuiRecipe) gui).getHandlerName();
|
||||
}
|
||||
|
||||
ItemPanels.bookmarkPanel.addOrRemoveItem(stackover.copy(), recipeId);
|
||||
ItemPanels.bookmarkPanel.addOrRemoveItem(stackover.copy(), handlerName, ingredients);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user