kangarko / ChatControl-Pro

The ultimate chat solution. Prevent spam, ads, swears and even bots on your server. Replaced by ChatControl Red: https://mineacademy.org/chatcontrol-red
Other
66 stars 8 forks source link

Can you make CHC's custom JS pleaceholders useable on other plugins that supports PAPI? #1870

Closed anar4732 closed 4 years ago

anar4732 commented 4 years ago

for exemple i can use AbstractMenus' variables anywhere that supports PAPI.

thanks.

radiant-ai commented 4 years ago

AFAIK PAPI already has a JS addon which allows to create custom placeholders.

anar4732 commented 4 years ago

AFAIK PAPI already has a JS addon which allows to create custom placeholders.

PAPI not supports color codes like {#ffff00}

kangarko commented 4 years ago

No unfortunately this is out of scope of the ChatControl plugin and PAPI already has this functionality.

I am pretty sure you can use the Rhino JavaScript engine to call Java.of("net.md_5.bungee.api.ChatColor").of("#CCCCCC") or something like that to get the color working on 1.16

anar4732 commented 4 years ago

Java.of("net.md_5.bungee.api.ChatColor").of("#CCCCCC") this is not working even.

kangarko commented 4 years ago

Sorry, it is Java.type not Java.of

Please see https://winterbe.com/posts/2014/04/05/java8-nashorn-tutorial/ for a quick tutorial on running JavaScript.

Unfortunately I will not be able to assist you with creating JS variables. I understand PAPI lacks this feature, we may add it later but at presents our roadmap is already full.

anar4732 commented 4 years ago

No unfortunately this is out of scope of the ChatControl plugin and PAPI already has this functionality.

I am pretty sure you can use the Rhino JavaScript engine to call Java.of("net.md_5.bungee.api.ChatColor").of("#CCCCCC") or something like that to get the color working on 1.16

hi thank you for help. is it for just rhino or works with nashorn engine too?

kangarko commented 4 years ago

not sure, you'd have to test :)