Hello. Does DeluxeMenus parse papi placeholders asynchronously? If so is there a way to make them parse synchronously instead? Asking because an update was made to Denizen which prevents parsing of Denizen placeholders if a plugin is parsing asynchronously which unfortunately broke a lot of my menus. Here is a screenshot of what the Denizen dev has said to others running into the same issue: https://imgur.com/a/4c4zpwn
#DeluxeMenus & Denizen Placeholder
1 messages · Page 1 of 1 (latest)
you got few options:
- Wait for the response from dmenus devs
- Replace dmenus with denizen
- Downgrade depenizen until options
1)or2)are done (Not recommended)
I dk why my answer didn't go thru but yes. it parses it async.
The entire menu creation is async and this won't really change.
This is to prevent the server from lagging on creation since placeholder parsing can take a while when the expansions don't cache their data and stuff like that. It can also take time when they use custom heads since those make a request to mojang's api (just the ones that use player names) but those are cached after the first request so it's only really a problem when the menu is first open. But this can lead to the whole server being frozen for a temporary period of time which could be really inconvenient.
Hey...thanks for the response. I was afraid of that. I'm kind of at a loss on what to do here. I have over 80 DeluxeMenus and custom features built with Denizen so I've spent a lot of time with both plugins...I can't simply replace either without it being a lengthy nightmare task (plus Im not a fan of Denizens inventory script system). Any thoughts on the reasoning mcmonkey gave on why Denizen was updated to do this? From my perspective it seems more like an opinionated update than fact because its just parsing placeholders...I dont see it how thats going to corrupt my servers data if its done asyc...especially since I've been using both without any issues for years now. Of course...maybe I'm just missing something in their logic.
Also...any solutions you know of that aren't completely replacing either? Is it possible to have DM parse only denizen placeholders synchronously?
So, from what I Understand, when denizen placeholders are parsed, actual code is running in the background. Code that written wrongly can lead to issues indeed. I've personally never used denizen so I do not know how indepth it goes and how many things it allows you to do, but I definitely don't think that forcing people to do all the stuff sync as "the only solution". Now I also understand that denizen users are usually less experienced with development since the entire idea of the plugin is to be something easier than java that anyone can get into fairly easily so it might be the only easy way to stop non experienced users from doing something they might regret later.
Their thinking process was probably something like this: "If a user is non experienced this will stop them from doing something that they might regret and if the user is experienced they might as well use java at that point". Now this is just what I gathered from the little information I have.
And to answer these questions, no. to both unfortunately.
You can't just tell PlaceholderAPI what placeholders to parse and when. You give it the entire string and it parses all the placeholders. Now, we could make that process sync but I Don't think that will happen for the reasons given above.
This would just block the main thread and it is very common for expansions to be badly written.
If what I mentioned in the first sentence is true, then this is a perfect example of that. Instead of the data being cached and then that being displayed, it is calculated every time. Now, possibly, denziens gives you the ability to do that but assuming the same thing as above, users are not experienced with that and probably don't do it.