Did the MC chat connection, at least a test
This commit is contained in:
parent
8069c71663
commit
df75adb67a
1 changed files with 20 additions and 2 deletions
|
@ -1,7 +1,25 @@
|
||||||
package buttondevteam.discordplugin.listeners;
|
package buttondevteam.discordplugin.listeners;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
public class MCChatListener implements Listener {
|
import buttondevteam.discordplugin.DiscordPlugin;
|
||||||
// Custom event
|
import buttondevteam.lib.TBMCChatEvent;
|
||||||
|
import buttondevteam.lib.chat.Channel;
|
||||||
|
import buttondevteam.lib.chat.TBMCChatAPI;
|
||||||
|
import sx.blah.discord.api.events.IListener;
|
||||||
|
import sx.blah.discord.handle.impl.events.MessageReceivedEvent;
|
||||||
|
|
||||||
|
public class MCChatListener implements Listener, IListener<MessageReceivedEvent> {
|
||||||
|
@EventHandler
|
||||||
|
public void onMCChat(TBMCChatEvent e) {
|
||||||
|
DiscordPlugin.sendMessageToChannel(DiscordPlugin.chatchannel,
|
||||||
|
"[" + e.getChannel().DisplayName + "] <" + e.getSender().getName() + "> " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handle(MessageReceivedEvent event) {
|
||||||
|
TBMCChatAPI.SendChatMessage(Channel.GlobalChat, Bukkit.getConsoleSender(), event.getMessage().getContent());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue