PlaceholderAPI / Javascript-Expansion

Adds javascript placeholders
GNU General Public License v3.0
22 stars 24 forks source link

Registered commands with some fixes and new method #8

Closed aBooDyy closed 4 years ago

aBooDyy commented 5 years ago

Tested the expansion on 1.12.2 (guess if it works there it will for other versions) and everything seems fine. The only issue is that when u reload with /papi reload the /papijsp list command returns 0 scripts loaded and if you reloaded with /papijsp reload it works. but for reloading with /papi reload will not return the correct value if you added new placeholders. tried to fix that with many ways, but no luck. Not sure if what i'm thinking of is the problem but if it is, afaik theres no way to solve it :(

Compiled version if anyone wants to test it: https://aboodyy.net/PAPI-Expansion-Javascript.jar

I didn't change all of that, idk whats wrong with GitHub

aBooDyy commented 5 years ago
Zendrex commented 5 years ago

@aBo0oDyy A method for setBracketPlaceholders would be appreciated as well.

aBooDyy commented 5 years ago

Any reason for it?

Zendrex commented 5 years ago

Just consistency with the pr. Why have 1 without the other? Copy-paste with a different method from PAPI. 4 lines. Bet you someone would find a use for it. Also gotta get them commits up.

Done 663f383328302c555c4dcf4fc5ffeea227e5da4e

aBooDyy commented 5 years ago

What do you mean? so you want it for using papi placeholders in the js placeholder args %javascript_name_{placeholder}% ? if thats what you mean, it already parse the placeholders before passing them as args. here other than this, you can use setPAPIPlaceholder() with %% in your script with no issues.

If that's not what you want, explain exactly what do you want please.

aBooDyy commented 5 years ago

latest commit (a412155) just fixes the parsing of the placeholder if we used it inside of the script with %%, so to avoid that, i made it so you set the placeholder without %% in the setPAPIPlaceholder and setPAPIRelPlaceholder methods.