Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5a2c15e
Implement collapsible groups
Rsslone Mar 13, 2026
e7fe24c
Fix options, minor changes.
Rsslone Mar 13, 2026
6ba8779
Implement collapsible group settings
Rsslone Mar 13, 2026
fa64f47
Configuration Cleanup
Rsslone Mar 13, 2026
ce91f61
Fix hide ingredients mode.
Rsslone Mar 13, 2026
ce72aef
Fix Enchanted Book Groups
Rsslone Mar 13, 2026
1f66391
Searchable "Enchanted Book"
Rsslone Mar 13, 2026
c95b249
Update GuiCollapsibleGroups.java
Rsslone Mar 13, 2026
00ffcb6
Implement collapsed icon preview
Rsslone Mar 13, 2026
f68ec93
Implement Drag Selection
Rsslone Mar 13, 2026
9a448f9
Fix back button alignment
Rsslone Mar 13, 2026
3b67b1f
Implement scrolling preview lists
Rsslone Mar 14, 2026
e4d3f71
Searchable Group Names
Rsslone Mar 14, 2026
7c0e3be
Don't save group on new group.
Rsslone Mar 14, 2026
20791b2
Fancy group preview icons.
Rsslone Mar 14, 2026
23bf17c
Collapsed group lighting
Rsslone Mar 14, 2026
c7c930f
Cached baked models
Rsslone Mar 14, 2026
0ee24b9
Fix tooltip min size to hint width
Rsslone Mar 14, 2026
5468ca0
Implement Collapse on Close and Default Action
Rsslone Mar 14, 2026
b983d54
Translations
Rsslone Mar 14, 2026
cd1183c
Implement Alt+Click toggle HEI config menu
Rsslone Mar 14, 2026
cf984a6
Implement fluidstacks & 1 item groups as itemstack
Rsslone Mar 14, 2026
7fc95fa
Merge CollapsedStack and CollapsibleEntry.
Rsslone Mar 15, 2026
740c473
CollpasedStack use native Renderer
Rsslone Mar 15, 2026
1ee068f
Implement item selector wildcard & feedback
Rsslone Mar 15, 2026
271af0e
Fix single collapsedstack
Rsslone Mar 15, 2026
c4949f7
Item Selector Promote / Decompose
Rsslone Mar 18, 2026
f036d80
Fix Alignments and thin buttons
Rsslone Mar 18, 2026
89e87a1
Fixed client lag spikes on collapse/expand.
Rsslone Mar 22, 2026
b3156a2
Improved search latency
Rsslone Mar 22, 2026
0800495
Item selector QoL and delete prompts.
Rsslone Mar 22, 2026
57d486f
Bump Version
Rsslone Mar 22, 2026
5b8688b
Group membership cache
Rsslone Mar 22, 2026
5c17aa8
Fix api hidden items being shown
Rsslone Mar 25, 2026
3c4e3d9
Reload cache on show hidden in creative toggle.
Rsslone Mar 25, 2026
572f332
Implement ICollapsibleGroupRegistry API
Rsslone Mar 27, 2026
d62d714
Collapsible Stack API change & Manage Group merge
Rsslone Mar 28, 2026
ee6c907
Update ICollapsibleGroupRegistry Javadoc.
Rsslone Mar 28, 2026
5049bb0
Change ICollapsibleGroupRegistry to take lang key
Rsslone Mar 29, 2026
d59cf57
ICollapsibleGroup Builder.
Rsslone Apr 3, 2026
7a76170
Fix config imports
Rsslone Apr 3, 2026
96d82f8
ArrayList -> LinkedHashMap
Rsslone Apr 3, 2026
b86323c
CollapsedStack implements IIngredientListElement
Rsslone Apr 3, 2026
2e388d9
Fixed code regression
Rsslone Apr 3, 2026
14e0e3e
Revert enchanted book search fix
Rsslone Apr 3, 2026
3058e23
Corrected a comment.
Rsslone Apr 3, 2026
b617607
Changed JEI lang keys to HEI prefix.
Rsslone Apr 4, 2026
b1167af
Cleanup
Rsslone Apr 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ changelog.html
\.classpath
\.project
\.settings/
*.launch
*.launch
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ generate_javadocs_jar = false

# Mod Information
# HIGHLY RECOMMEND complying with SemVer for mod_version: https://semver.org/
mod_version = 4.29.15
mod_version = 4.30.0
root_package = mezz
mod_id = jei
mod_name = Had Enough Items
Expand Down
110 changes: 110 additions & 0 deletions src/api/java/mezz/jei/api/ICollapsibleGroupRegistry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package mezz.jei.api;

import mezz.jei.api.ingredients.IIngredientRegistry;
import mezz.jei.api.recipe.IIngredientType;

import java.util.function.Predicate;

/**
* Registry for mods to define collapsible groups in the HEI ingredient list.
* They can be toggled on/off by the user but cannot be edited or deleted.
*
* Obtain an instance via {@link IModPlugin#registerCollapsibleGroups(ICollapsibleGroupRegistry)}.
*
* EXAMPLE 1 — Group with filtered items:
*
* @Override
* public void registerCollapsibleGroups(ICollapsibleGroupRegistry registry) {
* registry.newGroup("matteroverdrive:colored_floor_tile", "tile.decorative.floor_tile.name")
* .addAny(VanillaTypes.ITEM,
* stack -> Block.getBlockFromItem(stack.getItem()) == MatterOverdrive.BLOCKS.decorative_floor_tile);
* }
*
*
* EXAMPLE 2 — Group mixing exact items, fluids, and all of a type:
*
* @Override
* public void registerCollapsibleGroups(ICollapsibleGroupRegistry registry) {
* registry.newGroup("mymod:my_group", "group.mymod.my_group")
* .add(new ItemStack(MyMod.Items.PICKAXE)) // add one exact item
* .add(new ItemStack(MyMod.Blocks.MY_BLOCK, 1, 1)) // add a specific block variant (meta=1)
* .add(FluidRegistry.getFluidStack("water", 1000)) // add an exact fluid
* .addAllOf(MyMod.CUSTOM_INGREDIENT_TYPE); // add every ingredient of a custom type
* }
*
*
* EXAMPLE 3 — Multiple groups from one plugin:
*
* @Override
* public void registerCollapsibleGroups(ICollapsibleGroupRegistry registry) {
* registry.newGroup("mymod:ores", "group.mymod.ores")
* .addAny(VanillaTypes.ITEM, stack -> isOre(stack));
*
* registry.newGroup("mymod:gems", "group.mymod.gems")
* .addAny(VanillaTypes.ITEM, stack -> isGem(stack));
* }
*
*
* @since HEI 4.30.0
*/
public interface ICollapsibleGroupRegistry {

/**
* Creates (or retrieves) a mod collapsible group builder.
*
* Multiple calls with the same {@code id} return a builder for the same logical group.
*
* @param id Unique group ID, should be namespaced with your mod ID.
* @param langKey Unlocalized translation key for the group name (e.g. {@code "tile.mymod.name"}).
*/
CollapsibleGroupBuilder newGroup(String id, String langKey);

interface CollapsibleGroupBuilder {
/**
* Add one exact ingredient to the group.
*
* The backend resolves this ingredient to its unique id and matches by id.
* Works with ItemStacks, FluidStacks, or any registered ingredient type.
*
* @param ingredient the ingredient to add (e.g. new ItemStack(Items.APPLE))
* @return this builder for chaining
*/
CollapsibleGroupBuilder add(Object ingredient);

/**
* Add multiple exact ingredients to the group. Equivalent to calling {@link #add(Object)}
* for each element in order.
*
* @param ingredients varargs list of ingredients to add
* @return this builder for chaining
*/
CollapsibleGroupBuilder add(Object... ingredients);

/**
* Add every ingredient of the given type(s) to the group — no filtering applied.
*
* Use this for custom ingredient types where you want to collapse all registered
* instances into one group. Third-party ingredient types registered via
* {@link IIngredientRegistry} are supported.
*
* <p>Note: passing {@code VanillaTypes.ITEM} or {@code VanillaTypes.FLUID} will match
* <em>every</em> item or fluid in the game. Prefer {@link #addAny} with a predicate
* when you only want a subset.
*
* @param types the ingredient type(s) whose every instance should be included
* @return this builder for chaining
*/
CollapsibleGroupBuilder addAllOf(IIngredientType<?>... types);

/**
* Add any ingredient of a given type that matches the provided predicate filter.
*
* Use this when you need to match items by condition (e.g. "all tools", "all ores", etc).
*
* @param type The ingredient type (e.g. {@code VanillaTypes.ITEM}).
* @param filter Predicate receiving a fully-typed {@code V} — no casting needed.
* @return this builder for chaining
*/
<V> CollapsibleGroupBuilder addAny(IIngredientType<V> type, Predicate<V> filter);
}
}
16 changes: 16 additions & 0 deletions src/api/java/mezz/jei/api/IModPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ default void registerCategories(IRecipeCategoryRegistration registry) {

}

/**
* Register collapsible ingredient groups provided by this mod.
* These appear in the "Manage Groups" screen tagged as "Mod" and can be toggled
* by the user but are not editable or deletable.
* <p>
* Use {@link ICollapsibleGroupRegistry#newGroup(String, String)} to create a builder
* and call its methods to define the group's members. See {@link ICollapsibleGroupRegistry}
* for full usage examples.
*
* @param registry the registry used to create collapsible group builders
* @since HEI 4.30.0
*/
default void registerCollapsibleGroups(ICollapsibleGroupRegistry registry) {

}

/**
* Register this mod plugin with the mod registry.
*/
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/mezz/jei/Internal.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import mezz.jei.bookmarks.BookmarkList;
import mezz.jei.color.ColorNamer;
import mezz.jei.gui.GuiEventHandler;
import mezz.jei.ingredients.CollapsedStackRegistry;
import mezz.jei.ingredients.IngredientFilter;
import mezz.jei.ingredients.IngredientRegistry;
import mezz.jei.input.InputHandler;
Expand Down Expand Up @@ -40,6 +41,8 @@ public final class Internal {
private static InputHandler inputHandler;
@Nullable
private static BookmarkList bookmarkList;
@Nullable
private static CollapsedStackRegistry collapsedStackRegistry;

private Internal() {

Expand Down Expand Up @@ -151,4 +154,16 @@ public static BookmarkList getBookmarkList() {
Preconditions.checkState(bookmarkList != null, "Bookmark List has not been created yet.");
return bookmarkList;
}

public static CollapsedStackRegistry getCollapsedStackRegistry() {
if (collapsedStackRegistry == null) {
collapsedStackRegistry = CollapsedStackRegistry.getInstance();
}
return collapsedStackRegistry;
}

public static void setCollapsedStackRegistry(CollapsedStackRegistry registry) {
Internal.collapsedStackRegistry = registry;
CollapsedStackRegistry.setInstance(registry);
}
}
101 changes: 100 additions & 1 deletion src/main/java/mezz/jei/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import mezz.jei.startup.ForgeModIdHelper;
import mezz.jei.startup.IModIdHelper;
import mezz.jei.util.GiveMode;
import mezz.jei.util.CollapsedClickAction;
import mezz.jei.util.Log;
import mezz.jei.util.Translator;
import net.minecraft.init.Items;
Expand All @@ -39,6 +40,7 @@
import java.io.IOException;
import java.util.*;
import java.util.List;
import java.util.ArrayList;

public final class Config {
private static final String configKeyPrefix = "config.jei";
Expand All @@ -49,6 +51,7 @@ public final class Config {
public static final String CATEGORY_RENDERING = "rendering";
public static final String CATEGORY_MISC = "misc";
public static final String CATEGORY_CATEGORY = "category";
public static final String CATEGORY_COLLAPSIBLE = "collapsible";

public static final String defaultModNameFormatFriendly = "blue italic";
public static final int smallestNumColumns = 4;
Expand All @@ -65,6 +68,8 @@ public final class Config {
@Nullable
private static LocalizedConfiguration searchColorsConfig;
@Nullable
private static CustomGroupsConfig customGroupsConfig;
@Nullable
private static File bookmarkFile;
@Nullable
private static File favoriteFile;
Expand All @@ -89,6 +94,39 @@ public static boolean isOverlayEnabled() {
KeyBindings.toggleOverlay.getKeyCode() == 0; // if there is no key binding to enable it, don't allow the overlay to be disabled
}

public static boolean isCollapsibleGroupsEnabled() {
return values.collapsibleGroupsEnabled;
}

public static boolean isCollapseOnClose() {
return values.collapseOnClose;
}

public static CollapsedClickAction getCollapsedClickAction() {
return values.collapsedClickAction;
}

@Nullable
public static CustomGroupsConfig getCustomGroupsConfig() {
return customGroupsConfig;
}

public static Set<String> getDisabledGroups() {
return values.disabledGroups;
}

public static void saveDisabledGroups(Set<String> disabledGroups) {
values.disabledGroups.clear();
values.disabledGroups.addAll(disabledGroups);
if (config != null) {
Property property = config.get(CATEGORY_COLLAPSIBLE, "disabledGroups", new String[]{});
property.set(disabledGroups.toArray(new String[0]));
if (config.hasChanged()) {
config.save();
}
}
}

public static void toggleOverlayEnabled() {
values.overlayEnabled = !values.overlayEnabled;

Expand Down Expand Up @@ -412,6 +450,9 @@ public static void preInit(FMLPreInitializationEvent event) {
itemBlacklistConfig = new LocalizedConfiguration(configKeyPrefix, itemBlacklistConfigFile, "0.1.0");
searchColorsConfig = new LocalizedConfiguration(configKeyPrefix, searchColorsConfigFile, "0.1.0");

customGroupsConfig = new CustomGroupsConfig(jeiConfigurationDir);
customGroupsConfig.load();

syncConfig();
syncItemBlacklistConfig();
syncSearchColorsConfig();
Expand Down Expand Up @@ -448,6 +489,10 @@ private static boolean syncConfig() {
config.addCategory(CATEGORY_SEARCH);
config.addCategory(CATEGORY_ADVANCED);
config.addCategory(CATEGORY_MISC);
config.addCategory(CATEGORY_COLLAPSIBLE);
// Override collapsible category lang keys from config.jei.* to config.hei.*
config.setCategoryLanguageKey(CATEGORY_COLLAPSIBLE, "config.hei.collapsible");
config.setCategoryComment(CATEGORY_COLLAPSIBLE, Translator.translateToLocal("config.hei.collapsible.comment"));

ConfigCategory modeCategory = config.getCategory("mode");
if (modeCategory != null) {
Expand Down Expand Up @@ -525,14 +570,68 @@ private static boolean syncConfig() {

values.tooltipShowRecipeBy = config.getBoolean(CATEGORY_MISC, "tooltipShowRecipeBy", defaultValues.tooltipShowRecipeBy);

values.showHiddenIngredientsInCreative = config.getBoolean(CATEGORY_MISC, "showHiddenIngredientsInCreative", defaultValues.showHiddenIngredientsInCreative);
{
boolean prev = values.showHiddenIngredientsInCreative;
values.showHiddenIngredientsInCreative = config.getBoolean(CATEGORY_MISC, "showHiddenIngredientsInCreative", defaultValues.showHiddenIngredientsInCreative);
if (prev != values.showHiddenIngredientsInCreative) {
needsReload = true;
}
}

values.skipShowingProgressBar = config.getBoolean(CATEGORY_MISC, "skipShowingProgressBar", defaultValues.skipShowingProgressBar);

values.hideBottomRightCornerConfigButton = config.getBoolean(CATEGORY_MISC, "hideBottomRightCornerConfigButton", defaultValues.hideBottomRightCornerConfigButton);

values.hideBottomLeftCornerBookmarkButton = config.getBoolean(CATEGORY_MISC, "hideBottomLeftCornerBookmarkButton", defaultValues.hideBottomLeftCornerBookmarkButton);

{
boolean prev = values.collapsibleGroupsEnabled;
values.collapsibleGroupsEnabled = config.getBoolean(CATEGORY_COLLAPSIBLE, "collapsibleGroupsEnabled", defaultValues.collapsibleGroupsEnabled);
if (prev != values.collapsibleGroupsEnabled) {
needsReload = true;
}
}

values.collapseOnClose = config.getBoolean(CATEGORY_COLLAPSIBLE, "collapseOnClose", defaultValues.collapseOnClose);

values.collapsedClickAction = config.getEnum("collapsedClickAction", CATEGORY_COLLAPSIBLE, defaultValues.collapsedClickAction, CollapsedClickAction.values());

// Override property lang keys and comments from config.jei.collapsible.* to config.hei.collapsible.*
{
String heiPrefix = "config.hei.collapsible.";

Property collapsibleGroupsEnabledProp = config.get(CATEGORY_COLLAPSIBLE, "collapsibleGroupsEnabled", defaultValues.collapsibleGroupsEnabled);
collapsibleGroupsEnabledProp.setLanguageKey(heiPrefix + "collapsibleGroupsEnabled");
collapsibleGroupsEnabledProp.setComment(Translator.translateToLocal(heiPrefix + "collapsibleGroupsEnabled.comment"));

Property collapseOnCloseProp = config.get(CATEGORY_COLLAPSIBLE, "collapseOnClose", defaultValues.collapseOnClose);
collapseOnCloseProp.setLanguageKey(heiPrefix + "collapseOnClose");
collapseOnCloseProp.setComment(Translator.translateToLocal(heiPrefix + "collapseOnClose.comment"));

Property collapsedClickActionProp = config.get(CATEGORY_COLLAPSIBLE, "collapsedClickAction", defaultValues.collapsedClickAction.name());
collapsedClickActionProp.setLanguageKey(heiPrefix + "collapsedClickAction");
String defaultLocalized = Translator.translateToLocal("config.jei.default");
String validLocalized = Translator.translateToLocal("config.jei.valid");
collapsedClickActionProp.setComment(Translator.translateToLocal(heiPrefix + "collapsedClickAction.comment")
+ "\n[" + defaultLocalized + ": " + defaultValues.collapsedClickAction.name().toLowerCase(Locale.ENGLISH) + "]"
+ "\n[" + validLocalized + ": " + Arrays.toString(collapsedClickActionProp.getValidValues()) + ']');
}

// Explicit property order so the GUI shows collapsibleGroupsEnabled first, then collapseOnClose.
List<String> collapsibleOrder = new ArrayList<>();
collapsibleOrder.add("collapsibleGroupsEnabled");
collapsibleOrder.add("collapseOnClose");
collapsibleOrder.add("collapsedClickAction");
config.setCategoryPropertyOrder(CATEGORY_COLLAPSIBLE, collapsibleOrder);

{
String[] disabledGroupsArray = config.getStringList("disabledGroups", CATEGORY_COLLAPSIBLE, new String[]{});
Property disabledProp = config.get(CATEGORY_COLLAPSIBLE, "disabledGroups", new String[]{});
disabledProp.setShowInGui(false);
values.disabledGroups.clear();
Collections.addAll(values.disabledGroups, disabledGroupsArray);
}

{
Property property = config.get(CATEGORY_ADVANCED, "debugModeEnabled", defaultValues.debugModeEnabled);
property.setShowInGui(false);
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/mezz/jei/config/ConfigValues.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package mezz.jei.config;

import mezz.jei.util.CollapsedClickAction;
import mezz.jei.util.GiveMode;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class ConfigValues {
// advanced
Expand Down Expand Up @@ -53,4 +56,10 @@ public class ConfigValues {

// category
public List<String> categoryUidOrder = new ArrayList<>();

// collapsible groups
public boolean collapsibleGroupsEnabled = true;
public boolean collapseOnClose = false;
public CollapsedClickAction collapsedClickAction = CollapsedClickAction.OPEN_GROUP;
public Set<String> disabledGroups = new HashSet<>();
}
Loading