1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-23 06:45:04 +02:00

2.9 Merges

Make /vanish follow the same rules as /fly, /god and /gamemode
Add espawn to plugin.yml
Allow your hat to be removed with /hat remove
void silent command failures on /hat (ie typing /hat fish will no longer silently return as if broken)
Fix /exp so it can be used in the console
Using /exp, show can't find player message, if no matching player is found

Replace op ignore exempt with ignore exempt chat permission:
essentials.chat.ignoreexempt
This permission won't prevent a player from ignoring the player, but the player will see the chat messages anyway.
Fix chat showing [spy] prefix when social spy was not required to see the message
Players should not be able to ignore Console
Also implement chat exempt permission in other commands.
Prevent joinbots from triggering join code, unless they are actually connected to the server and online.
This commit is contained in:
ementalo
2012-06-18 13:55:25 +01:00
parent 88e7e684af
commit 89eca7d991
15 changed files with 184 additions and 101 deletions

View File

@@ -37,36 +37,35 @@ public class EssentialsLocalChatEventListener implements Listener
{
String type = _("chatTypeLocal");
final IUser user = ess.getUser(onlinePlayer);
//TODO: remove reference to op
if (user.isIgnoringPlayer(sender.getName()) && !sender.isOp())
if (user.isIgnoringPlayer(ess.getUser(sender)))
{
continue;
}
if (!user.equals(sender))
{
if (Permissions.CHAT_SPY.isAuthorized(user))
boolean abort = false;
final Location playerLoc = user.getLocation();
if (playerLoc.getWorld() != world)
{
type = type.concat(_("chatTypeSpy"));
abort = true;
}
else
{
final Location playerLoc = user.getLocation();
if (playerLoc.getWorld() != world)
{
continue;
}
final double delta = playerLoc.distanceSquared(loc);
final double delta = playerLoc.distanceSquared(loc);
if (delta > event.getRadius())
{
continue;
}
if (delta > event.getRadius())
{
abort = true;
}
final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage()));
user.sendMessage(message);
if (abort)
{
if (ChatPermissions.getPermission("spy").isAuthorized(user))
{
type = type.concat(_("chatTypeSpy"));
}
}
}
final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage()));
user.sendMessage(message);
}
}
}
}