#Placeholders not working

1 messages · Page 1 of 1 (latest)

vast rain
#

In latest update of fancynpc placeholders are not working as name

slow fox
#

Update to latest dev build

#

I don't remember what the issue was, but once you're running latest dev build, unfortunately you may need to re-apply skins for all NPCs that were previously not working.

#

But I'm not 100% sure whether that is the case. In any case, let me know.

vast rain
slow fox
#

Can you give me an example of the placeholder you're using as well as the return value from /papi parse me (placeholder)?

vast rain
#

%cmi_baltop_name_1%

#

Is returning the name of the firt player in baltop

slow fox
#

What's the name? Does the player have cracked account? There's a known issue that skins of cracked players are printing a console error when being fetched.

vast rain
#

I downgraded fancynpc and fancyhologram to version 2.4.2

#

There are premium accounts and cracked accounts

#

I will remain with version 2.4.2 for now

slow fox
#

Well, latest dev build of FancyNpcs should fix the placeholder issue and the fix was confirmed to work by a few other people. However, there are still some problems with setting skins to invalid / cracked usernames. I think the most we can do is to suppress the console error and/or make plugin do not send request to the MineSkin API when invalid username is specified. In some cases it'd still require a call to the MojangAPI however.
It's impossible to support cracked players because they simply cannot have skins.

vast rain
#

I don't care about cracked players

slow fox
#

It should already work on latest dev build

vast rain
#

Not working for me

slow fox
#

Did you re-apply the skin as I suggested?

vast rain
#

Yes

slow fox
#

Basically set it once again, eg. /npc skin (npc) %cmi_baltop_name_1%

#

Hmm

#

Will test in a moment

vast rain
#

I have a test server also where I test this

#

If you want you can join the test server and test it yourself

#

It have same folia build and plugins as my survival server

#

I just se this in console

vast rain
slow fox
#

and /papi parse me %cmi_baltop_name_1% returns a player name, correct?

vast rain
#

Yes

#

A premium player name

#

My other account

slow fox
#

How are you even using PlaceholderAPI on Folia? It throws this error upon loading.

[13:19:32 ERROR]: [DirectoryProviderSource] Error loading plugin: Could not load plugin 'PlaceholderAPI v2.11.6' as it is not marked as supporting Folia!
#

nvm I found the fork

#

Hmm, okay. I'm able to reproduce this issue as well. This is weird. I'll let Oliver know. Thanks for reporting.

solar solstice
#

Does the placeholder work without specifying a player? What does it say with /papi parse --null %cmi_baltop_name_1%

slow fox
solar solstice
#

The placeholder has to be independent from any player

#

So it must successfully parse when using --null as player: /papi parse --null

slow fox
#

Hm, okay - I see. I think that's new tho, isn't it?

solar solstice
#

I don't think so, but I'm not 100% sure

#

But it would be quite difficult to change that with the current system, since the skins get loaded per npc and not per player viewing an npc

slow fox
#

Yeah understandable. Weird to see %cmi_baltop_name_1% needs a player though. 🤔

#

Will update plugins on my server and see if it works with Topper placeholders. (They should work with --null)

#

Does indeed work.

#

We still need to fix this however: (and stacktrace that happens along with this error)

solar solstice
#

it comes from this return null;, because it couldn't parse the placeholder -> probably requires a player

slow fox
#

Yeah makes sense. Isn't there a pre-made translation for situation like this? I recall we added something when introducing placeholder skins for the first time.

#

Unless null can be returned in other scenario, this should be perfect solution. May need to re-phrase the warning. Hold on, I think I can PR it. (Tho this will take a few minutes because of paperweight caches 😡)

solar solstice
#

we had

 npc_skin_failure_invalid_name_or_url: "<dark_gray>› {errorColor}Argument {warningColor}{input}{errorColor} is not a valid player name or URL."
```
and

npc_skin_failure_invalid: "<dark_gray>› {errorColor}Argument {warningColor}{input}{errorColor} is invalid. Common issues: invalid URL, player not found, player has no skin."

#

It can also return null, if the UUIDFetcher fails, the URL is invalid or the file does not exists

slow fox
#

Hm okay. Maybe we should throw different exceptions from within the getByIdentifier method?

#

And catch them in the command logic.

solar solstice
#

Yeah we could make a custom exception "SkinFailedToLoad", add a short reason to it, catch it and send the reason ("COuld not load skin: <reason>" or something") to the player

slow fox
#

Alright, I can do this.