mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-22 18:09:06 +00:00
Merged in feature/essx-discord-hook (pull request #10)
Add EssentialsX Discord Support Approved-by: Aust1n46
This commit is contained in:
commit
8991cb7edd
20
pom.xml
20
pom.xml
@ -96,6 +96,10 @@
|
|||||||
<id>bungeecord-repo</id>
|
<id>bungeecord-repo</id>
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>essentialsx-repo</id>
|
||||||
|
<url>https://repo.essentialsx.net/snapshots/</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -150,6 +154,22 @@
|
|||||||
<version>0.96.7.0</version>
|
<version>0.96.7.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>net.md-5</groupId>
|
||||||
<artifactId>bungeecord-api</artifactId>
|
<artifactId>bungeecord-api</artifactId>
|
||||||
|
@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.essentialsx.api.v2.services.discord.DiscordService;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
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.
|
//This class listens to chat through the chat event and handles the bulk of the chat channels and formatting.
|
||||||
public class ChatListener implements Listener {
|
public class ChatListener implements Listener {
|
||||||
|
private final boolean essentialsDiscordHook = Bukkit.getPluginManager().isPluginEnabled("EssentialsDiscord");
|
||||||
private MineverseChat plugin = MineverseChat.getInstance();
|
private MineverseChat plugin = MineverseChat.getInstance();
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
@ -525,6 +527,10 @@ public class ChatListener implements Listener {
|
|||||||
Format.sendPacketPlayOutChat(p, packet);
|
Format.sendPacketPlayOutChat(p, packet);
|
||||||
}
|
}
|
||||||
Bukkit.getConsoleSender().sendMessage(consoleChat);
|
Bukkit.getConsoleSender().sendMessage(consoleChat);
|
||||||
|
|
||||||
|
if (essentialsDiscordHook && channel.isDefaultchannel()) {
|
||||||
|
Bukkit.getServicesManager().load(DiscordService.class).sendChatMessage(mcp.getPlayer(), chat);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3,19 +3,19 @@ version: ${project.version}
|
|||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
main: mineverse.Aust1n46.chat.MineverseChat
|
main: mineverse.Aust1n46.chat.MineverseChat
|
||||||
depend: [Vault, ProtocolLib, PlaceholderAPI]
|
depend: [Vault, ProtocolLib, PlaceholderAPI]
|
||||||
softdepend: [Towny, Factions, Heroes]
|
softdepend: [Towny, Factions, Heroes, EssentialsDiscord]
|
||||||
author: Aust1n46
|
author: Aust1n46
|
||||||
website: https://bitbucket.org/Aust1n46/venturechat/
|
website: https://bitbucket.org/Aust1n46/venturechat/
|
||||||
description: #1 Channels Chat plugin! Spigot + Bungee. Supports PlaceholderAPI + JSON formatting. Moderation GUI!
|
description: #1 Channels Chat plugin! Spigot + Bungee. Supports PlaceholderAPI + JSON formatting. Moderation GUI!
|
||||||
commands:
|
commands:
|
||||||
mute:
|
mute:
|
||||||
usage: /mute [playername] [channel]
|
usage: /mute [playername] [channel]
|
||||||
aliases: [mp,vmute]
|
aliases: [mp,vmute]
|
||||||
description: Mutes player in a channel so they cannot talk.
|
description: Mutes player in a channel so they cannot talk.
|
||||||
permission-message: You don't have <permission>
|
permission-message: You don't have <permission>
|
||||||
unmute:
|
unmute:
|
||||||
usage: /unmute [playername] [channel]
|
usage: /unmute [playername] [channel]
|
||||||
aliases: [ump,vunmute]
|
aliases: [ump,vunmute]
|
||||||
description: Unmutes player in a channel so they can talk again.
|
description: Unmutes player in a channel so they can talk again.
|
||||||
permission-message: You don't have <permission>
|
permission-message: You don't have <permission>
|
||||||
msg:
|
msg:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user