Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 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
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.CollapsibleEntryRegistry;
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 CollapsibleEntryRegistry collapsibleEntryRegistry;

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 CollapsibleEntryRegistry getCollapsibleEntryRegistry() {
if (collapsibleEntryRegistry == null) {
collapsibleEntryRegistry = CollapsibleEntryRegistry.getInstance();
}
return collapsibleEntryRegistry;
}

public static void setCollapsibleEntryRegistry(CollapsibleEntryRegistry registry) {
Internal.collapsibleEntryRegistry = registry;
CollapsibleEntryRegistry.setInstance(registry);
}
}
68 changes: 68 additions & 0 deletions 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 Down Expand Up @@ -49,6 +50,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 +67,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 +93,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 +449,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 +488,7 @@ private static boolean syncConfig() {
config.addCategory(CATEGORY_SEARCH);
config.addCategory(CATEGORY_ADVANCED);
config.addCategory(CATEGORY_MISC);
config.addCategory(CATEGORY_COLLAPSIBLE);

ConfigCategory modeCategory = config.getCategory("mode");
if (modeCategory != null) {
Expand Down Expand Up @@ -533,6 +574,33 @@ private static boolean syncConfig() {

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());

// Explicit property order so the GUI shows collapsibleGroupsEnabled first, then collapseOnClose.
java.util.List<String> collapsibleOrder = new java.util.ArrayList<>();
Comment thread
Rsslone marked this conversation as resolved.
Outdated
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
8 changes: 8 additions & 0 deletions src/main/java/mezz/jei/config/ConfigValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
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 +55,10 @@ public class ConfigValues {

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

// collapsible groups
public boolean collapsibleGroupsEnabled = true;
public boolean collapseOnClose = false;
public mezz.jei.util.CollapsedClickAction collapsedClickAction = mezz.jei.util.CollapsedClickAction.OPEN_GROUP;
Comment thread
Rsslone marked this conversation as resolved.
Outdated
public Set<String> disabledGroups = new HashSet<>();
}
103 changes: 103 additions & 0 deletions src/main/java/mezz/jei/config/CustomGroupsConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package mezz.jei.config;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import mezz.jei.util.Log;

import javax.annotation.Nullable;
import java.io.*;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

/**
* Manages custom collapsible groups persistence as JSON.
* File: config/jei/customCollapsibleGroups.json
*/
public class CustomGroupsConfig {
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
private static final Type GROUP_LIST_TYPE = new TypeToken<List<CustomGroup>>() {}.getType();

private final File configFile;
private List<CustomGroup> customGroups = new ArrayList<>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to use a Map<String, CustomGroup> here, to fix updateGroup method O(n) lookup => O(1) lookup.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


public CustomGroupsConfig(File configDir) {
this.configFile = new File(configDir, "customCollapsibleGroups.json");
}

public void load() {
if (!configFile.exists()) {
customGroups = new ArrayList<>();
return;
}
try (Reader reader = new InputStreamReader(new FileInputStream(configFile), StandardCharsets.UTF_8)) {
List<CustomGroup> loaded = GSON.fromJson(reader, GROUP_LIST_TYPE);
customGroups = loaded != null ? loaded : new ArrayList<>();
} catch (Exception e) {
Log.get().error("Failed to load custom collapsible groups from {}", configFile, e);
customGroups = new ArrayList<>();
}
}

public void save() {
try (Writer writer = new OutputStreamWriter(new FileOutputStream(configFile), StandardCharsets.UTF_8)) {
GSON.toJson(customGroups, GROUP_LIST_TYPE, writer);
} catch (Exception e) {
Log.get().error("Failed to save custom collapsible groups to {}", configFile, e);
}
}

public List<CustomGroup> getCustomGroups() {
return customGroups;
}

public void addGroup(CustomGroup group) {
customGroups.add(group);
save();
Comment thread
Rsslone marked this conversation as resolved.
Outdated
}

public void removeGroup(String id) {
customGroups.removeIf(g -> g.id.equals(id));
Comment thread
Rsslone marked this conversation as resolved.
Outdated
save();
}

public void updateGroup(CustomGroup updated) {
for (int i = 0; i < customGroups.size(); i++) {
if (customGroups.get(i).id.equals(updated.id)) {
customGroups.set(i, updated);
save();
return;
}
}
// Not found — add as new
addGroup(updated);
Comment thread
Rsslone marked this conversation as resolved.
Outdated
}

/**
* A user-defined collapsible group stored as JSON.
* Items are identified by their unique identifier string from StackHelper.
*/
public static class CustomGroup {
public String id;
public String displayName;
public List<String> itemUids;

public CustomGroup() {
this.id = "";
this.displayName = "";
this.itemUids = new ArrayList<>();
}

public CustomGroup(String id, String displayName, List<String> itemUids) {
this.id = id;
this.displayName = displayName;
this.itemUids = new ArrayList<>(itemUids);
}

public CustomGroup copy() {
return new CustomGroup(id, displayName, new ArrayList<>(itemUids));
}
}
}
Loading