mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 10:39:05 +00:00
Add JSON message remover to Bungee messages from DiscordSRV
This commit is contained in:
parent
203428539e
commit
6bf60b6c6d
@ -760,12 +760,23 @@ public class MineverseChat extends JavaPlugin implements PluginMessageListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(subchannel.equals("DiscordSRV")) {
|
if(subchannel.equals("DiscordSRV")) {
|
||||||
String chatchannel = msgin.readUTF();
|
String chatChannel = msgin.readUTF();
|
||||||
String message = msgin.readUTF();
|
String message = msgin.readUTF();
|
||||||
if(ChatChannel.isChannel(chatchannel) && ChatChannel.getChannel(chatchannel).getBungee()) {
|
if(!ChatChannel.isChannel(chatChannel)) {
|
||||||
for(MineverseChatPlayer p : MineverseChat.onlinePlayers) {
|
return;
|
||||||
p.getPlayer().sendMessage(Format.FormatStringAll(message));
|
}
|
||||||
}
|
ChatChannel chatChannelObj = ChatChannel.getChannel(chatChannel);
|
||||||
|
if(!chatChannelObj.getBungee()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String json = Format.convertPlainTextToJson(message, true);
|
||||||
|
int hash = (message.replaceAll("([§]([a-z0-9]))", "")).hashCode();
|
||||||
|
|
||||||
|
for(MineverseChatPlayer p : MineverseChat.onlinePlayers) {
|
||||||
|
String finalJSON = Format.formatModerationGUI(json, p.getPlayer(), "Discord", chatChannelObj.getName(), hash);
|
||||||
|
PacketContainer packet = Format.createPacketPlayOutChat(finalJSON);
|
||||||
|
Format.sendPacketPlayOutChat(p.getPlayer(), packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(subchannel.equals("Chwho")) {
|
if(subchannel.equals("Chwho")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user