Brikster / Chatty

Bukkit-compatible chat management system
MIT License
92 stars 47 forks source link

API #49

Open Vankka opened 4 years ago

Vankka commented 4 years ago

Hey, looking to hook Chatty into DiscordSRV, I'd need;

Brikster commented 4 years ago

Hello. I will make API classes as soon as possible)

Brikster commented 4 years ago

Hello! Sorry for a longtime pause.

I made API classes in dev. version. You can see them in repository now, check out "api" module. Version with API will be released soon.

Get access to API you can from "ru.mrbrikster.chatty.Chatty.class" instance: ((Chatty) Bukkit.getPlugin("Chatty")).api()

Vankka commented 4 years ago

The main class (ru.mrbrikster.chatty.Chatty.class) isn't available within the api module, you may want to have a interface for the api method and have the main class implement that, so something like;

((IChatty) Bukkit.getPluginManager().getPlugin("Chatty")).api()

could be used, right now the only way is to use reflection or include the main plugin source as well

Vankka commented 3 years ago

It seems that the API is giving no recipients, so messages being sent to Chats via the API are being sent to 0 players

Brikster commented 3 years ago

It gave no recipients with "single world" and local chats when using them with API. New version fixed this issue, now you can send messages to any chat that have any range value.