Skip to content

Commit e9f57e6

Browse files
added socketed line hider, bumped version to 1.3.0, and added changelog
1 parent b4bb747 commit e9f57e6

8 files changed

Lines changed: 75 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes are listed here, newest first.
44

5+
## v1.3.0 2026-06-17
6+
7+
### Added
8+
- added the socketed_line_mode setting, which hides the "Socketed (X)" affix line unless Alt is held
9+
10+
### Changed
11+
- narrowed the affix sort options to alphabetical and default, dropping the rarity and type options that never worked
12+
- logged a warning when the socket compactor cannot read Apotheosis internals instead of disabling silently
13+
14+
### Fixed
15+
- fixed cooldown and stacking markers not hiding on nested gem bonuses like bloody arrow, treasure goblin, fortification, and leech block
16+
517
## v1.2.2 2026-06-03
618

719
### Changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A Forge 1.19.2 mod that cleans up the affix and gem tooltips Apotheosis adds to
1313
- Always hide the affix source line (not configurable).
1414
- Hide the `[⌛ MM:SS]` cooldown markers and `[Stacking]` tags on affix lines without touching the affix text. Hold Alt to reveal.
1515
- Strip prefixes from affix names.
16-
- Sort affix lines by rarity, alphabetical, type, or default.
16+
- Sort affix lines alphabetically, or leave them in Apotheosis's default order.
1717
- Hide individual affixes by translation key prefix.
1818
- Hide potion style affix descriptions.
1919

@@ -51,9 +51,11 @@ The affix source line is always hidden. There is no config option for it.
5151

5252
`affix_extras_mode` controls the `[⌛ MM:SS]` cooldown markers and `[Stacking]` tags on affix lines; the affix text itself is never touched, only the bracketed annotations. `show` keeps them, `alt` (default) hides them unless Alt is held, `delete` removes them permanently.
5353

54+
`socketed_line_mode` controls the "Socketed (X)" affix line on items that have sockets. `show` keeps it, `alt` (default) hides it unless Alt is held, `delete` removes it permanently.
55+
5456
### gem display
5557

56-
`gem_tooltip_mode` controls raw gem tooltips. `full` keeps Apotheosis's original layout. `compact` (default) strips the "Fits In" header and the Unique tag and keeps the category bullets. `ultra` puts every category on one line. `hidden` removes all gem info.
58+
`gem_tooltip_mode` controls raw gem tooltips. `full` keeps Apotheosis's original layout. `compact` (default) keeps the "Fits In" header and the category bullets, and drops the Unique tag. `ultra` puts every category on one line. `hidden` removes all gem info.
5759

5860
`hidden_gem_categories` is a list of category names to hide from "Fits In" lists. Case insensitive. Works in `full`, `compact`, and `ultra` modes; no effect when `gem_tooltip_mode` is `hidden` since that mode strips all gem info anyway. If every category is hidden, the "Fits In:" header is also dropped. Example: `["Bows", "Crossbows"]` on a pack that disables ranged weapons.
5961

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ mod_name=Apothic Tooltip Cleanup
3636
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
3737
mod_license=MIT
3838
# The mod version. See https://semver.org/
39-
mod_version=1.2.2
39+
mod_version=1.3.0
4040
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
4141
# This should match the base package used for the mod sources.
4242
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

src/main/java/com/nightwielder/apothictooltipcleanup/Config.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class Config {
2323
public static final ForgeConfigSpec.ConfigValue<String> DURABILITY_BONUS_MODE;
2424
public static final ForgeConfigSpec.ConfigValue<String> POTION_DESCRIPTIONS_MODE;
2525
public static final ForgeConfigSpec.ConfigValue<String> AFFIX_EXTRAS_MODE;
26+
public static final ForgeConfigSpec.ConfigValue<String> SOCKETED_LINE_MODE;
2627

2728
// Gem display (raw gems)
2829
public static final ForgeConfigSpec.ConfigValue<String> GEM_TOOLTIP_MODE;
@@ -87,11 +88,17 @@ public class Config {
8788
" delete = always hidden, Alt has no effect");
8889
AFFIX_EXTRAS_MODE = builder.defineInList("affix_extras_mode", HideMode.ALT, HideMode.OPTIONS);
8990

91+
builder.comment(" The \"Socketed (X)\" line on items that have sockets.",
92+
" show = always visible",
93+
" alt = hidden unless Alt is held",
94+
" delete = always hidden, Alt has no effect");
95+
SOCKETED_LINE_MODE = builder.defineInList("socketed_line_mode", HideMode.ALT, HideMode.OPTIONS);
96+
9097
builder.comment(" gem display (raw gems)",
9198
" ============================================================",
9299
" How raw gem tooltips display.",
93100
" full = original Apotheosis layout",
94-
" compact = strip headers, keep per bullet categories and bonuses",
101+
" compact = keep the category and bonus bullets, drop the Unique tag",
95102
" ultra = one line for categories, one line for bonuses",
96103
" hidden = remove all gem info");
97104
GEM_TOOLTIP_MODE = builder.defineInList("gem_tooltip_mode", "compact", Arrays.asList("full", "compact", "ultra", "hidden"));

src/main/java/com/nightwielder/apothictooltipcleanup/handler/AffixSorter.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,9 @@ public static void apply(List<Component> tooltip, String sortOrder) {
3131
return;
3232
}
3333

34-
Comparator<Component> comparator = comparatorFor(sortOrder);
35-
if (comparator == null) {
36-
return;
37-
}
38-
39-
affixLines.sort(comparator);
34+
affixLines.sort(Comparator.comparing(c -> c.getString(), String.CASE_INSENSITIVE_ORDER));
4035
for (int i = 0; i < indices.size(); i++) {
4136
tooltip.set(indices.get(i), affixLines.get(i));
4237
}
4338
}
44-
45-
private static Comparator<Component> comparatorFor(String sortOrder) {
46-
return switch (sortOrder) {
47-
case "alphabetical" -> Comparator.comparing(c -> c.getString(), String.CASE_INSENSITIVE_ORDER);
48-
default -> null;
49-
};
50-
}
5139
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.nightwielder.apothictooltipcleanup.handler;
2+
3+
import com.nightwielder.apothictooltipcleanup.Config;
4+
import com.nightwielder.apothictooltipcleanup.util.HideMode;
5+
import com.nightwielder.apothictooltipcleanup.util.TooltipMatcher;
6+
import net.minecraft.client.gui.screens.Screen;
7+
import net.minecraft.network.chat.Component;
8+
import net.minecraft.network.chat.contents.TranslatableContents;
9+
10+
import java.util.List;
11+
12+
// Hides the "Socketed (X)" affix line that Apoth 6.x adds to socketed items. The socket affix has no
13+
// name, only this description, and Apoth wraps it in a dot_prefix bullet, so the affix key sits in
14+
// arg[0] of the bullet rather than at the top level where getKey would see it.
15+
public final class SocketLineHider {
16+
private static final String SOCKET_DESC_KEY = "affix.apotheosis:socket.desc";
17+
18+
private SocketLineHider() {}
19+
20+
// Drops the socket line when the mode hides it and returns true if the hidden line is alt revealable.
21+
public static boolean apply(List<Component> tooltip) {
22+
String mode = Config.SOCKETED_LINE_MODE.get();
23+
boolean altDown = Screen.hasAltDown();
24+
if (!HideMode.hides(mode, altDown)) {
25+
return false;
26+
}
27+
boolean removed = tooltip.removeIf(SocketLineHider::isSocketLine);
28+
return removed && HideMode.revealable(mode, altDown);
29+
}
30+
31+
static boolean isSocketLine(Component component) {
32+
if (!TooltipMatcher.isBulletPrefix(component)) {
33+
return false;
34+
}
35+
if (!(component.getContents() instanceof TranslatableContents tc)) {
36+
return false;
37+
}
38+
Object[] args = tc.getArgs();
39+
if (args.length == 0 || !(args[0] instanceof Component inner)) {
40+
return false;
41+
}
42+
return SOCKET_DESC_KEY.equals(TooltipMatcher.getKey(inner));
43+
}
44+
}

src/main/java/com/nightwielder/apothictooltipcleanup/handler/TooltipHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public static void onTooltip(ItemTooltipEvent event) {
6262
anyHidden |= PotionDescriptionToggle.apply(stack, tooltip);
6363
}
6464
anyHidden |= DurabilityHider.apply(tooltip);
65+
anyHidden |= SocketLineHider.apply(tooltip);
6566

6667
AltExpandHandler.apply(tooltip, anyHidden);
6768

src/main/java/com/nightwielder/apothictooltipcleanup/util/TooltipMatcher.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ public static boolean keyStartsWith(Component component, String prefix) {
4949
return key != null && key.startsWith(prefix);
5050
}
5151

52-
// Returns true for a bullet line, which Apoth 6.x wraps in dot_prefix.
52+
// Returns true for a bullet line. Apoth wraps affix and gem bullets in dot_prefix, and newer versions
53+
// also use star_prefix for some affix lines, so both count as bullets or those lines slip every check.
5354
public static boolean isBulletPrefix(Component component) {
54-
return keyStartsWith(component, "text.apotheosis.dot_prefix");
55+
return keyStartsWith(component, "text.apotheosis.dot_prefix")
56+
|| keyStartsWith(component, "text.apotheosis.star_prefix");
5557
}
5658

5759
// Tells affix bullets from gem bonus bullets. Gem bonuses have a ":" before any other punctuation.

0 commit comments

Comments
 (0)