mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
Fix chat showing [spy] prefix when social spy was not required to see the message.
Fixes #2263
This commit is contained in:
parent
5da886593b
commit
a764f8c929
1 changed files with 12 additions and 9 deletions
|
@ -127,23 +127,26 @@ public abstract class EssentialsChatPlayer implements Listener
|
|||
}
|
||||
if (!onlineUser.equals(sender))
|
||||
{
|
||||
if (onlineUser.isAuthorized("essentials.chat.spy"))
|
||||
{
|
||||
type = type.concat(_("chatTypeSpy"));
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean abort = false;
|
||||
final Location playerLoc = onlineUser.getLocation();
|
||||
if (playerLoc.getWorld() != world)
|
||||
{
|
||||
continue;
|
||||
abort = true;
|
||||
}
|
||||
final double delta = playerLoc.distanceSquared(loc);
|
||||
if (delta > chatStore.getRadius())
|
||||
{
|
||||
continue;
|
||||
abort = true;
|
||||
}
|
||||
}
|
||||
if (abort) {
|
||||
if (onlineUser.isAuthorized("essentials.chat.spy"))
|
||||
{
|
||||
type = type.concat(_("chatTypeSpy"));
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
String message = String.format(event.getFormat(), type.concat(sender.getDisplayName()), event.getMessage());
|
||||
|
|
Loading…
Reference in a new issue