mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-30 09:49:51 +02:00
Some user matching updates
This commit is contained in:
@@ -24,7 +24,7 @@ public class Commandxmpp extends EssentialsCommand
|
||||
else
|
||||
{
|
||||
final String message = getFinalArg(args, 1);
|
||||
final String senderName = sender instanceof Player ? ess.getUser((Player)sender).getDisplayName() : Console.NAME;
|
||||
final String senderName = sender instanceof Player ? ess.getUserMap().getUser((Player)sender).getDisplayName() : Console.NAME;
|
||||
sender.sendMessage("[" + senderName + ">" + address + "] " + message);
|
||||
if (!EssentialsXMPP.getInstance().sendMessage(address, "[" + senderName + "] " + message))
|
||||
{
|
||||
|
@@ -92,7 +92,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
|
||||
public IUser getUserByAddress(final String address)
|
||||
{
|
||||
String username = instance.users.getUserByAddress(address);
|
||||
return username == null ? null : ess.getUser(username);
|
||||
return username == null ? null : ess.getUserMap().getUser(username);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -23,21 +23,21 @@ class EssentialsXMPPPlayerListener implements Listener
|
||||
@EventHandler(priority= EventPriority.MONITOR)
|
||||
public void onPlayerJoin(final PlayerJoinEvent event)
|
||||
{
|
||||
final IUser user = ess.getUser(event.getPlayer());
|
||||
final IUser user = ess.getUserMap().getUser(event.getPlayer());
|
||||
sendMessageToSpyUsers("Player " + user.getDisplayName() + " joined the game");
|
||||
}
|
||||
|
||||
@EventHandler(priority= EventPriority.MONITOR)
|
||||
public void onPlayerChat(final PlayerChatEvent event)
|
||||
{
|
||||
final IUser user = ess.getUser(event.getPlayer());
|
||||
final IUser user = ess.getUserMap().getUser(event.getPlayer());
|
||||
sendMessageToSpyUsers(String.format(event.getFormat(), user.getDisplayName(), event.getMessage()));
|
||||
}
|
||||
|
||||
@EventHandler(priority= EventPriority.MONITOR)
|
||||
public void onPlayerQuit(final PlayerQuitEvent event)
|
||||
{
|
||||
final IUser user = ess.getUser(event.getPlayer());
|
||||
final IUser user = ess.getUserMap().getUser(event.getPlayer());
|
||||
sendMessageToSpyUsers("Player " + user.getDisplayName() + " left the game");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user