Skip to content

Commit a0dc42d

Browse files
added affix line diagnostic logging
1 parent 667076d commit a0dc42d

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
import net.minecraft.ChatFormatting;
66
import net.minecraft.client.gui.screens.Screen;
77
import net.minecraft.network.chat.Component;
8+
import org.slf4j.Logger;
9+
import org.slf4j.LoggerFactory;
810

911
import java.util.Iterator;
1012
import java.util.List;
1113

1214
public final class AltExpandHandler {
15+
private static final Logger logger = LoggerFactory.getLogger("ApothicTooltipCleanup-Diag");
16+
1317
private AltExpandHandler() {}
1418

1519
// Alt is the expand modifier: Shift triggers vanilla quick-move and EpicFight's innate skill
@@ -26,6 +30,21 @@ public static void apply(List<Component> tooltip) {
2630
int liveIndex = 0;
2731
int insertIndex = -1;
2832
int affixesRemoved = 0;
33+
34+
// Temporary diagnostic: when the held item is named with a "diag" marker, log every
35+
// tooltip line that isAffixLine matches. Remove once the affix-matching bug is found.
36+
if (!tooltip.isEmpty()) {
37+
String itemName = tooltip.get(0).getString();
38+
if (itemName.toLowerCase().contains("diag")) {
39+
for (int i = 0; i < tooltip.size(); i++) {
40+
Component line = tooltip.get(i);
41+
if (TooltipMatcher.isAffixLine(line)) {
42+
logger.info("[ATC-AFFIX] item={} lineIndex={} text={} key={}", itemName, i, line.getString(), TooltipMatcher.getKey(line));
43+
}
44+
}
45+
}
46+
}
47+
2948
Iterator<Component> it = tooltip.iterator();
3049
while (it.hasNext()) {
3150
Component line = it.next();

0 commit comments

Comments
 (0)