diff --git a/gradle.properties b/gradle.properties index d80687c..c8079c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.daemon=false # General Specifications mc_version=1.12.2 -mod_version=0.2 +mod_version=0.2.1 forge_version=14.23.5.2847 jei_version=4.16.1.302 mod_group=com.github.vfyjxf.jeiutilities diff --git a/src/main/java/com/github/vfyjxf/jeiutilities/gui/BookmarkInputHandler.java b/src/main/java/com/github/vfyjxf/jeiutilities/gui/BookmarkInputHandler.java index ba5da6f..a475eb7 100644 --- a/src/main/java/com/github/vfyjxf/jeiutilities/gui/BookmarkInputHandler.java +++ b/src/main/java/com/github/vfyjxf/jeiutilities/gui/BookmarkInputHandler.java @@ -114,6 +114,8 @@ public void onMouseClicked(GuiScreenEvent.MouseInputEvent event) { if (recipeInfo != null) { IFocus.Mode mode = recipeInfo.isInputMode() ? IFocus.Mode.INPUT : IFocus.Mode.OUTPUT; recipesGui.show(new Focus(mode, recipeInfo.getIngredient())); + JeiUtilitiesPlugin.getGrid().removeElement(0); + JeiUtilitiesPlugin.getGrid().addHistoryIngredient(recipeInfo.getResult()); IngredientLookupState state = getState(); if (state != null) { state.setRecipeCategoryIndex(recipeInfo.getRecipeCategoryIndex()); @@ -142,6 +144,8 @@ public void onKeyPressed(GuiScreenEvent.KeyboardInputEvent event) { if (recipeInfo != null) { IFocus.Mode mode = recipeInfo.isInputMode() ? IFocus.Mode.INPUT : IFocus.Mode.OUTPUT; recipesGui.show(new Focus(mode, recipeInfo.getIngredient())); + JeiUtilitiesPlugin.getGrid().removeElement(0); + JeiUtilitiesPlugin.getGrid().addHistoryIngredient(recipeInfo.getResult()); IngredientLookupState state = getState(); if (state != null) { state.setRecipeCategoryIndex(recipeInfo.getRecipeCategoryIndex()); diff --git a/src/main/java/com/github/vfyjxf/jeiutilities/jei/AdvancedIngredientGrid.java b/src/main/java/com/github/vfyjxf/jeiutilities/jei/AdvancedIngredientGrid.java index f70b767..c6cf40d 100644 --- a/src/main/java/com/github/vfyjxf/jeiutilities/jei/AdvancedIngredientGrid.java +++ b/src/main/java/com/github/vfyjxf/jeiutilities/jei/AdvancedIngredientGrid.java @@ -222,6 +222,11 @@ public void addHistoryIngredient(Object value) { } + public void removeElement(int index){ + historyIngredientElements.remove(index); + guiHistoryIngredientSlots.set(0, historyIngredientElements); + } + private T normalize(T ingredient) { IIngredientHelper ingredientHelper = ingredientRegistry.getIngredientHelper(ingredient); T copy = LegacyUtil.getIngredientCopy(ingredient, ingredientHelper);