mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 10:39:05 +00:00
Pass player display name over Bungee
This commit is contained in:
parent
8d913b6ce7
commit
e44dfe9f07
@ -705,7 +705,6 @@ public class MineverseChat extends JavaPlugin implements PluginMessageListener {
|
|||||||
String globalJSON = msgin.readUTF();
|
String globalJSON = msgin.readUTF();
|
||||||
String primaryGroup = msgin.readUTF();
|
String primaryGroup = msgin.readUTF();
|
||||||
String nickname = msgin.readUTF();
|
String nickname = msgin.readUTF();
|
||||||
System.out.println(nickname);
|
|
||||||
|
|
||||||
if(!ChatChannel.isChannel(chatchannel)) {
|
if(!ChatChannel.isChannel(chatchannel)) {
|
||||||
return;
|
return;
|
||||||
@ -727,7 +726,7 @@ public class MineverseChat extends JavaPlugin implements PluginMessageListener {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
//Create VentureChatEvent
|
//Create VentureChatEvent
|
||||||
VentureChatEvent ventureChatEvent = new VentureChatEvent(null, senderName, primaryGroup, chatChannelObject, recipients, format, chat, globalJSON, hash, false);
|
VentureChatEvent ventureChatEvent = new VentureChatEvent(null, senderName, nickname, primaryGroup, chatChannelObject, recipients, format, chat, globalJSON, hash, false);
|
||||||
//Fire event and wait for other plugin listeners to act on it
|
//Fire event and wait for other plugin listeners to act on it
|
||||||
Bukkit.getServer().getPluginManager().callEvent(ventureChatEvent);
|
Bukkit.getServer().getPluginManager().callEvent(ventureChatEvent);
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ public class VentureChatEvent extends Event {
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private final MineverseChatPlayer mcp;
|
private final MineverseChatPlayer mcp;
|
||||||
private final String username;
|
private final String username;
|
||||||
|
private final String nickname;
|
||||||
private final String playerPrimaryGroup;
|
private final String playerPrimaryGroup;
|
||||||
private final ChatChannel channel;
|
private final ChatChannel channel;
|
||||||
private final Set<Player> recipients;
|
private final Set<Player> recipients;
|
||||||
@ -28,10 +29,11 @@ public class VentureChatEvent extends Event {
|
|||||||
private final int hash;
|
private final int hash;
|
||||||
private final boolean bungee;
|
private final boolean bungee;
|
||||||
|
|
||||||
public VentureChatEvent(MineverseChatPlayer mcp, String username, String playerPrimaryGroup, ChatChannel channel, Set<Player> recipients, String format, String chat, String globalJSON, int hash, boolean bungee) {
|
public VentureChatEvent(MineverseChatPlayer mcp, String username, String nickname, String playerPrimaryGroup, ChatChannel channel, Set<Player> recipients, String format, String chat, String globalJSON, int hash, boolean bungee) {
|
||||||
super(MineverseChat.ASYNC);
|
super(MineverseChat.ASYNC);
|
||||||
this.mcp = mcp;
|
this.mcp = mcp;
|
||||||
this.username = username;
|
this.username = username;
|
||||||
|
this.nickname = nickname;
|
||||||
this.playerPrimaryGroup = playerPrimaryGroup;
|
this.playerPrimaryGroup = playerPrimaryGroup;
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
this.recipients = recipients;
|
this.recipients = recipients;
|
||||||
@ -50,6 +52,10 @@ public class VentureChatEvent extends Event {
|
|||||||
return this.username;
|
return this.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNickname() {
|
||||||
|
return this.nickname;
|
||||||
|
}
|
||||||
|
|
||||||
public String getPlayerPrimaryGroup() {
|
public String getPlayerPrimaryGroup() {
|
||||||
return this.playerPrimaryGroup;
|
return this.playerPrimaryGroup;
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,7 @@ public class ChatListener implements Listener {
|
|||||||
int hash = message.hashCode();
|
int hash = message.hashCode();
|
||||||
|
|
||||||
//Create VentureChatEvent
|
//Create VentureChatEvent
|
||||||
VentureChatEvent ventureChatEvent = new VentureChatEvent(mcp, mcp.getName(), MineverseChat.permission.getPrimaryGroup(mcp.getPlayer()), eventChannel, recipients, format, chat, globalJSON, hash, bungee);
|
VentureChatEvent ventureChatEvent = new VentureChatEvent(mcp, mcp.getName(), mcp.getNickname(), MineverseChat.permission.getPrimaryGroup(mcp.getPlayer()), eventChannel, recipients, format, chat, globalJSON, hash, bungee);
|
||||||
//Fire event and wait for other plugin listeners to act on it
|
//Fire event and wait for other plugin listeners to act on it
|
||||||
Bukkit.getServer().getPluginManager().callEvent(ventureChatEvent);
|
Bukkit.getServer().getPluginManager().callEvent(ventureChatEvent);
|
||||||
//Call method to send the processed chat
|
//Call method to send the processed chat
|
||||||
|
Loading…
x
Reference in New Issue
Block a user