mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-22 18:09:06 +00:00
Add EssentialsX Discord Support
This commit is contained in:
parent
a49f856470
commit
a18c722f27
20
pom.xml
20
pom.xml
@ -96,6 +96,10 @@
|
||||
<id>bungeecord-repo</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>essentialsx-repo</id>
|
||||
<url>https://repo.essentialsx.net/snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -150,6 +154,22 @@
|
||||
<version>0.96.7.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.essentialsx</groupId>
|
||||
<artifactId>EssentialsXDiscord</artifactId>
|
||||
<version>2.19.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>net.dv8tion</groupId>
|
||||
<artifactId>JDA</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
|
@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.util.Set;
|
||||
|
||||
import net.essentialsx.api.v2.services.discord.DiscordService;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
@ -33,6 +34,7 @@ import mineverse.Aust1n46.chat.utilities.Format;
|
||||
|
||||
//This class listens to chat through the chat event and handles the bulk of the chat channels and formatting.
|
||||
public class ChatListener implements Listener {
|
||||
private final boolean essentialsDiscordHook = Bukkit.getPluginManager().isPluginEnabled("EssentialsDiscord");
|
||||
private MineverseChat plugin = MineverseChat.getInstance();
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
@ -525,6 +527,10 @@ public class ChatListener implements Listener {
|
||||
Format.sendPacketPlayOutChat(p, packet);
|
||||
}
|
||||
Bukkit.getConsoleSender().sendMessage(consoleChat);
|
||||
|
||||
if (essentialsDiscordHook && channel.isDefaultchannel()) {
|
||||
Bukkit.getServicesManager().load(DiscordService.class).sendChatMessage(mcp.getPlayer(), chat);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
@ -3,7 +3,7 @@ version: ${project.version}
|
||||
api-version: 1.13
|
||||
main: mineverse.Aust1n46.chat.MineverseChat
|
||||
depend: [Vault, ProtocolLib, PlaceholderAPI]
|
||||
softdepend: [Towny, Factions, Heroes]
|
||||
softdepend: [Towny, Factions, Heroes, EssentialsDiscord]
|
||||
author: Aust1n46
|
||||
website: https://bitbucket.org/Aust1n46/venturechat/
|
||||
description: #1 Channels Chat plugin! Spigot + Bungee. Supports PlaceholderAPI + JSON formatting. Moderation GUI!
|
||||
|
Loading…
x
Reference in New Issue
Block a user