Skip to content

Commit

Permalink
Add a 1.12.2 config for the position of new bookmarks (#3114)
Browse files Browse the repository at this point in the history
  • Loading branch information
WaitingIdly committed Feb 12, 2023
1 parent b2e632e commit eac5cda
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/mezz/jei/bookmarks/BookmarkList.java
Expand Up @@ -46,7 +46,7 @@ public BookmarkList(IngredientRegistry ingredientRegistry) {
public <T> boolean add(T ingredient) {
Object normalized = normalize(ingredient);
if (!contains(normalized)) {
if (addToLists(normalized, true)) {
if (addToLists(normalized, Config.isAddingBookmarksToFront())) {
notifyListenersOfChange();
saveBookmarks();
return true;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/mezz/jei/config/Config.java
Expand Up @@ -184,6 +184,10 @@ public static boolean isOptimizeMemoryUsage() {
return values.optimizeMemoryUsage;
}

public static boolean isAddingBookmarksToFront() {
return values.addBookmarksToFront;
}

public static GiveMode getGiveMode() {
return values.giveMode;
}
Expand Down Expand Up @@ -420,6 +424,8 @@ private static boolean syncConfig() {

values.optimizeMemoryUsage = config.getBoolean(CATEGORY_ADVANCED, "optimizeMemoryUsage", defaultValues.optimizeMemoryUsage);

values.addBookmarksToFront = config.getBoolean(CATEGORY_ADVANCED, "addBookmarksToFront", defaultValues.addBookmarksToFront);

values.giveMode = config.getEnum("giveMode", CATEGORY_ADVANCED, defaultValues.giveMode, GiveMode.values());

values.maxColumns = config.getInt("maxColumns", CATEGORY_ADVANCED, defaultValues.maxColumns, smallestNumColumns, largestNumColumns);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/mezz/jei/config/ConfigValues.java
Expand Up @@ -7,6 +7,7 @@ public class ConfigValues {
public boolean debugModeEnabled = false;
public boolean centerSearchBarEnabled = false;
public boolean optimizeMemoryUsage = true;
public boolean addBookmarksToFront = false;
public GiveMode giveMode = GiveMode.MOUSE_PICKUP;
public String modNameFormat = Config.parseFriendlyModNameFormat(Config.defaultModNameFormatFriendly);
public int maxColumns = 100;
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/jei/lang/en_us.lang
Expand Up @@ -103,6 +103,8 @@ config.jei.advanced.giveMode=Give Mode
config.jei.advanced.giveMode.comment=Choose if JEI should give ingredients direct to the inventory (inventory) or pick them up with the mouse (mouse_pickup).
config.jei.advanced.optimizeMemoryUsage=Optimize Memory Usage
config.jei.advanced.optimizeMemoryUsage.comment=Enable JEI memory usage optimizations.
config.jei.advanced.addBookmarksToFront=Prepend New Bookmarks
config.jei.advanced.addBookmarksToFront.comment=When true, adds new bookmarks to the front of the bookmark list. When false, adds new bookmarks to the end of the bookmark list.

# Hide Ingredients Mode
gui.jei.editMode.description=JEI Hide Ingredients Mode:
Expand Down

0 comments on commit eac5cda

Please sign in to comment.