add-placeholder
Installation
SKILL.md
add-placeholder
Critical
- Only edit one file:
core/src/main/java/dev/colocated/litebansdiscordbridge/util/PlaceholderReplacer.java - Never break the null-guard at the top of
replace()—if (text == null || entry == null) return text;must stay first. - All fallback strings must be non-null literals (
"Unknown","Never","No reason specified", etc.) — nevernull. - Do not add imports that aren't already present unless a new helper method requires one.
Instructions
-
Read the file
core/src/main/java/dev/colocated/litebansdiscordbridge/util/PlaceholderReplacer.javain full. Verifyreplace(String text, Entry entry, PlatformAdapter platform)is the method you will modify before proceeding. -
Determine which pattern fits the new placeholder:
- Simple (direct Entry getter, cheap): add a
.replace("%name%", entry.getX() != null ? entry.getX() : "Fallback")line inside the existing chained block (lines ~51–67). - Expensive or needs helper (e.g., async lookup, formatting, parsing): add a
text.contains("%name%")guard block after the chained block, calling a newprivate statichelper method.
- Simple (direct Entry getter, cheap): add a