Notify players if their party member joins
This commit is contained in:
parent
4c1da52c9b
commit
8f6b8675b5
|
|
@ -271,6 +271,7 @@ public final class Config {
|
||||||
public static String SENT_PARTY_INV = "<green>You send a chat party invite to <player>!</green>";
|
public static String SENT_PARTY_INV = "<green>You send a chat party invite to <player>!</green>";
|
||||||
public static String JOIN_PARTY_CLICK_MESSAGE = "<click:run_command:'/party join <party> <party_password>'>" +
|
public static String JOIN_PARTY_CLICK_MESSAGE = "<click:run_command:'/party join <party> <party_password>'>" +
|
||||||
"<dark_aqua>You received an invite to join <party> click this message to accept.</dark_aqua></click>";
|
"<dark_aqua>You received an invite to join <party> click this message to accept.</dark_aqua></click>";
|
||||||
|
public static String PARTY_MEMBER_ONLINE = "<dark_aqua>[ChatParty] <player> joined Altitude!</dark_aqua>";
|
||||||
public static String PARTY_INFO = """
|
public static String PARTY_INFO = """
|
||||||
<gold><bold>Chat party info</bold>:
|
<gold><bold>Chat party info</bold>:
|
||||||
</gold><green>Name: <dark_aqua><party></dark_aqua>
|
</gold><green>Name: <dark_aqua><party></dark_aqua>
|
||||||
|
|
@ -298,6 +299,7 @@ public final class Config {
|
||||||
NOT_A_PARTY_MEMBER = getString("party.messages.not-a-party-member", NOT_A_PARTY_MEMBER);
|
NOT_A_PARTY_MEMBER = getString("party.messages.not-a-party-member", NOT_A_PARTY_MEMBER);
|
||||||
JOIN_PARTY_CLICK_MESSAGE = getString("party.messages.join-party-click-message", JOIN_PARTY_CLICK_MESSAGE);
|
JOIN_PARTY_CLICK_MESSAGE = getString("party.messages.join-party-click-message", JOIN_PARTY_CLICK_MESSAGE);
|
||||||
SENT_PARTY_INV = getString("party.messages.sent-party-invite", SENT_PARTY_INV);
|
SENT_PARTY_INV = getString("party.messages.sent-party-invite", SENT_PARTY_INV);
|
||||||
|
PARTY_MEMBER_ONLINE = getString("party.messages.party-member-online", PARTY_MEMBER_ONLINE);
|
||||||
PARTY_INFO = getString("party.messages.party-info", PARTY_INFO);
|
PARTY_INFO = getString("party.messages.party-info", PARTY_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.alttd.velocitychat.listeners;
|
package com.alttd.velocitychat.listeners;
|
||||||
|
|
||||||
|
import com.alttd.chat.managers.ChatUserManager;
|
||||||
|
import com.alttd.chat.objects.ChatUser;
|
||||||
import com.alttd.chat.util.Utility;
|
import com.alttd.chat.util.Utility;
|
||||||
import com.alttd.velocitychat.VelocityChat;
|
import com.alttd.velocitychat.VelocityChat;
|
||||||
import com.alttd.chat.config.Config;
|
import com.alttd.chat.config.Config;
|
||||||
|
|
@ -32,11 +34,14 @@ public class ProxyPlayerListener {
|
||||||
UUID uuid = player.getUniqueId();
|
UUID uuid = player.getUniqueId();
|
||||||
Party party = PartyManager.getParty(event.getPlayer().getUniqueId());
|
Party party = PartyManager.getParty(event.getPlayer().getUniqueId());
|
||||||
if (party == null) return;
|
if (party == null) return;
|
||||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
ChatUser chatUser = ChatUserManager.getChatUser(uuid);
|
||||||
out.writeUTF("partylogin");
|
if (chatUser == null)
|
||||||
out.writeUTF(String.valueOf(party.getPartyId()));
|
return;
|
||||||
out.writeUTF(uuid.toString());
|
VelocityChat.getPlugin().getChatHandler().sendPartyMessage(party,
|
||||||
VelocityChat.getPlugin().getProxy().getAllServers().forEach(registeredServer -> registeredServer.sendPluginMessage(VelocityChat.getPlugin().getChannelIdentifier(), out.toByteArray()));
|
Utility.parseMiniMessage(Config.PARTY_MEMBER_ONLINE, List.of(
|
||||||
|
Template.template("player", chatUser.getDisplayName())
|
||||||
|
)),
|
||||||
|
chatUser.getIgnoredPlayers());
|
||||||
// TODO setup ChatUser on Proxy
|
// TODO setup ChatUser on Proxy
|
||||||
//VelocityChat.getPlugin().getChatHandler().addPlayer(new ChatPlayer(event.getPlayer().getUniqueId()));
|
//VelocityChat.getPlugin().getChatHandler().addPlayer(new ChatPlayer(event.getPlayer().getUniqueId()));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user