Skip to content

Commit

Permalink
Add removePresetByName
Browse files Browse the repository at this point in the history
  • Loading branch information
strubium committed Oct 15, 2024
1 parent 2428885 commit 355c09f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/mcjty/theoneprobe/gui/PresetBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ public static void removeAll() {
presets.clear();
}

/**
* Remove a preset by name.
*
* @param name The name of the preset to remove.
* @return true if the preset was removed, false if not found.
*/
public static boolean removePresetByName(String name) {
return presets.removeIf(preset -> preset.getName().equals(name));
}

public static void addDefaultPresets() {
presets.add(new Preset("Default", 0xff999999, 0x55006699, 2, 0));
presets.add(new Preset("WAILA", 0xff4503d0, 0xff000000, 1, 1));
Expand Down

0 comments on commit 355c09f

Please sign in to comment.