Matt-MX / DisplayNameTags

Replace boring old nametags with Display Entities!
MIT License
26 stars 2 forks source link

[Bug] Essentials Nicknames Not Working #32

Open PhoenixFireTea opened 4 days ago

PhoenixFireTea commented 4 days ago

I have been attempting to have Essentials nicknames appear in my nametags, but regardless of what I try it does not work. I am not sure if this is supported, but it seemed like it would / could be. Using essentials, I do /nick Coyotea &#900c3fCoyotea. If I have the formatter set to legacy, the hex color does not appear, and instead placeholders like %essentials_nickname% and %player_displayname% appear without color, as shown below. It appears in-game in chat and on TAB just fine, but not on the nametag itself.

defaults:
  # If not enabled then plugin simulates vanilla name tags
  enabled: true
  # How often should we refresh tags (in milliseconds)
  refresh-every: 1
  # Lines of text to display.
  text:
    - "%player_displayname%"
    - "%essentials_nickname%"

2024-11-25_02 20 24

2024-11-25_02 23 08

2024-11-25_02 24 06

If I do minimessage as the formatter, the entire nametag disappears and I get the error that "Legacy formatting codes have been detected in a MiniMessage string - this is unsupported behaviour."

[02:31:43 WARN]: Async task for NameTags v1.3-commit-ac52164 generated an exception
net.kyori.adventure.text.minimessage.internal.parser.ParsingExceptionImpl: Legacy formatting codes have been detected in a MiniMessage string - this is unsupported behaviour. Please refer to the Adventure documentation (https://docs.advntr.dev) for more information.
    §x§9§0§0§c§3§fCoyotea§r
      ^^
    at net.kyori.adventure.text.minimessage.internal.parser.TokenParser.parseString(TokenParser.java:170) ~[adventure-text-minimessage-4.17.0.jar:?]
    at net.kyori.adventure.text.minimessage.internal.parser.TokenParser.resolvePreProcessTags(TokenParser.java:112) ~[adventure-text-minimessage-4.17.0.jar:?]
    at net.kyori.adventure.text.minimessage.MiniMessageParser.parseToTree(MiniMessageParser.java:195) ~[adventure-text-minimessage-4.17.0.jar:?]
    at net.kyori.adventure.text.minimessage.MiniMessageParser.parseFormat(MiniMessageParser.java:209) ~[adventure-text-minimessage-4.17.0.jar:?]
    at net.kyori.adventure.text.minimessage.MiniMessageImpl.deserialize(MiniMessageImpl.java:80) ~[adventure-text-minimessage-4.17.0.jar:?]
    at net.kyori.adventure.text.minimessage.MiniMessageImpl.deserialize(MiniMessageImpl.java:46) ~[adventure-text-minimessage-4.17.0.jar:?]
    at DisplayNameTags-1.3.jar/com.mattmx.nametags.config.TextFormatter.lambda$static$0(TextFormatter.java:15) ~[DisplayNameTags-1.3.jar:?]
    at DisplayNameTags-1.3.jar/com.mattmx.nametags.config.TextFormatter.format(TextFormatter.java:42) ~[DisplayNameTags-1.3.jar:?]
    at DisplayNameTags-1.3.jar/com.mattmx.nametags.config.TextDisplayMetaConfiguration.convertToComponent(TextDisplayMetaConfiguration.java:183) ~[DisplayNameTags-1.3.jar:?]
    at DisplayNameTags-1.3.jar/com.mattmx.nametags.config.TextDisplayMetaConfiguration.lambda$applyTextMeta$0(TextDisplayMetaConfiguration.java:27) ~[DisplayNameTags-1.3.jar:?]
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708) ~[?:?]
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    at java.base/java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:662) ~[?:?]
    at DisplayNameTags-1.3.jar/com.mattmx.nametags.config.TextDisplayMetaConfiguration.applyTextMeta(TextDisplayMetaConfiguration.java:35) ~[DisplayNameTags-1.3.jar:?]
    at DisplayNameTags-1.3.jar/com.mattmx.nametags.config.ConfigDefaultsListener.lambda$registerDefaultRefreshListener$2(ConfigDefaultsListener.java:69) ~[DisplayNameTags-1.3.jar:?]
    at DisplayNameTags-1.3.jar/com.mattmx.nametags.entity.trait.RefreshTrait.lambda$onEnable$0(RefreshTrait.java:41) ~[DisplayNameTags-1.3.jar:?]
    at io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler$AsyncScheduledTask.run(FoliaAsyncScheduler.java:217) ~[paper-1.21.1.jar:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

2024-11-25_02 31 30

Matt-MX commented 3 days ago

In your config.yml change formatter: minimessage to formatter: legacy.

PhoenixFireTea commented 3 days ago

This did not fix the issue of the color of the nick not appearing on the nametag, as I mentioned previously. "If I have the formatter set to legacy, the hex color does not appear, and instead placeholders like %essentials_nickname% and %player_displayname% appear without color, as shown below. It appears in-game in chat and on TAB just fine, but not on the nametag itself."

Matt-MX commented 3 days ago

Oh my bad I didn't see the message between the screenshots

Matt-MX commented 3 days ago

I'll check this out tomorrow if I can get my laptop to get intellij working lmfao

Matt-MX commented 3 days ago

Can I please have your entire config please @PhoenixFireTea just for consistency?

PhoenixFireTea commented 3 days ago

Edit since I forgot to mention it: I'm on 1.21.1 if that helps at all. Here is my NameTags Config: https://paste.md-5.net/adoqadufeq.shell

Here is my Essentials Config: https://paste.md-5.net/ekagududud.coffeescript

I have also found that it gives me the following error when I do /nametags-reload when I have my nick set as &#900c3fCoyotea :

[14:33:59 INFO]: Coyotea issued server command: /nick Coyotea &#900c3fCoyotea
[14:34:03 INFO]: Coyotea issued server command: /nametags-reload
[14:34:03 INFO]: Using LEGACY as text formatter.
[14:34:03 WARN]: Async task for NameTags v1.3-commit-ac52164 generated an exception
java.util.ConcurrentModificationException: null
    at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1863) ~[?:?]
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]
    at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?]
    at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?]
    at DisplayNameTags-1.3.jar/com.mattmx.nametags.config.ConfigDefaultsListener.lambda$registerDefaultRefreshListener$2(ConfigDefaultsListener.java:76) ~[DisplayNameTags-1.3.jar:?]
    at DisplayNameTags-1.3.jar/com.mattmx.nametags.entity.trait.RefreshTrait.lambda$onEnable$0(RefreshTrait.java:41) ~[DisplayNameTags-1.3.jar:?]
    at io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler$AsyncScheduledTask.run(FoliaAsyncScheduler.java:217) ~[paper-1.21.1.jar:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Matt-MX commented 1 day ago

@PhoenixFireTea Im not really able to access MC atm to test it, can you see if other legacy formatting things work?

e.g. %luckperms_prefix% or something for a rank with the meta prefix &#010101Rank

PhoenixFireTea commented 12 hours ago

When I set my luckperms prefix to prefix.100.&#C70039[Admin], and then display it in DisplayNameTags with %luckperms_prefix%, it does work with the legacy formatter. The %player_displayname% and %essentials_nickname% don't get set to the right color and seemingly go to defaults.

2024-11-28_17 32 07

code in DisplayNameTags config:

  text:
    - "%luckperms_prefix%"
    - "%player_displayname%"
    - "%essentials_nickname%"