1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-11 17:15:07 +02:00

2.9 -> 3.0 merge

This commit is contained in:
ementalo
2012-06-06 01:53:34 +01:00
parent 9b7a40736e
commit ff5a82a14c
21 changed files with 174 additions and 86 deletions

View File

@@ -112,6 +112,7 @@ public abstract class EssentialsChatPlayer implements Listener
protected void handleLocalChat(final PlayerChatEvent event, final ChatStore chatStore)
{
long radius = 0;
ISettings settings = ess.getSettings();
settings.acquireReadLock();
@@ -143,26 +144,6 @@ public abstract class EssentialsChatPlayer implements Listener
event.setFormat(_(format.toString(), event.getFormat()));
return;
}
if (!onlineUser.equals(sender))
{
if (onlineUser.isAuthorized("essentials.chat.spy"))
{
type = type.concat(_("chatTypeSpy"));
}
else
{
final Location playerLoc = onlineUser.getLocation();
if (playerLoc.getWorld() != world)
{
continue;
}
final double delta = playerLoc.distanceSquared(loc);
if (delta > chatStore.getRadius())
{
continue;
}
}
}
final StringBuilder errorMsg = new StringBuilder();
errorMsg.append("notAllowedTo").append(chatStore.getType().substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatStore.getType().substring(1));

View File

@@ -44,28 +44,29 @@ public class EssentialsLocalChatEventListener implements Listener
}
if (!user.equals(sender))
{
final Location playerLoc = user.getLocation();
if (playerLoc.getWorld() != world)
if (Permissions.CHAT_SPY.isAuthorized(user))
{
continue;
type = type.concat(_("chatTypeSpy"));
}
final double delta = playerLoc.distanceSquared(loc);
if (delta > event.getRadius())
else
{
if (Permissions.CHAT_SPY.isAuthorized(user))
final Location playerLoc = user.getLocation();
if (playerLoc.getWorld() != world)
{
type = type.concat(_("chatTypeSpy"));
continue;
}
else
final double delta = playerLoc.distanceSquared(loc);
if (delta > event.getRadius())
{
continue;
}
}
}
final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage()));
user.sendMessage(message);
final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage()));
user.sendMessage(message);
}
}
}
}