Patbox / TextPlaceholderAPI

Placeholder API for Fabric
GNU Lesser General Public License v3.0
39 stars 16 forks source link

Using directories in the `font` placeholder causes issues #42

Closed DBTDerpbox closed 11 months ago

DBTDerpbox commented 1 year ago

if a font file is placed in a folder in a resource pack and not at the root of the fonts folder for said resource pack's namespace, trying to target that font will prevent the text from displaying properly

Example of it functioning properly:

{
  "style_name": "Default",
  "update_tick_time": 20,
  "list_header": [
    "<font:custom_namespace:fontname><color:#fafafa>some text<font:default>\n\n\n\n",
    "<color:#1cf89e>%server:online%<color:#2f4049>/</color>%server:max_players%",
    ""
  ],
  "list_footer": [
    "",
    "<gray>TPS: %server:tps_colored% <dark_gray>| <gray>MSPT: %server:mspt_colored%",
    "<gray>Ping: <color:#ffba26>%player:ping_colored%</color>"
  ],
  "hidden_in_commands": false,
  "legacy_line_joining (Remove once updating!)": true
}

2023-09-15_04 57 36

Example of it breaking:

{
  "style_name": "Default",
  "update_tick_time": 20,
  "list_header": [
    "<font:custom_namespace:fontname/type1><color:#fafafa>some text<font:default>\n\n\n\n",
    "<color:#1cf89e>%server:online%<color:#2f4049>/</color>%server:max_players%",
    ""
  ],
  "list_footer": [
    "",
    "<gray>TPS: %server:tps_colored% <dark_gray>| <gray>MSPT: %server:mspt_colored%",
    "<gray>Ping: <color:#ffba26>%player:ping_colored%</color>"
  ],
  "hidden_in_commands": false,
  "legacy_line_joining (Remove once updating!)": true
}

2023-09-15_04 57 55

Using StyledPlayerList for this, I assumed TextPlaceholderAPI is whats breaking given this is using its features, sorry if this isn't the right place to report this.

Patbox commented 1 year ago

Could you check if that happens when you do <font:'custom_namespace:fontname/type1'>

DBTDerpbox commented 1 year ago

does seem to work properly, not sure why I didn't think of trying that