1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-09 16:17:37 +02:00

Players should not be able to ignore Console

Also implement chat exempt permission in other commands.
This commit is contained in:
KHobbits
2012-06-16 16:22:51 +01:00
parent 0e29e2ac60
commit 923f2732b4
9 changed files with 36 additions and 35 deletions

View File

@@ -63,7 +63,7 @@ public abstract class EssentialsChatPlayer implements Listener
case '?':
return "question";
//case '@':
//return "admin";
//return "admin";
default:
return "";
}
@@ -121,32 +121,34 @@ public abstract class EssentialsChatPlayer implements Listener
{
String type = _("chatTypeLocal");
final User onlineUser = ess.getUser(onlinePlayer);
if (onlineUser.isIgnoredPlayer(sender.getName()) && !sender.isAuthorized("essentials.chat.ignoreexempt"))
if (onlineUser.isIgnoredPlayer(sender))
{
continue;
}
if (!onlineUser.equals(sender))
{
boolean abort = false;
final Location playerLoc = onlineUser.getLocation();
if (playerLoc.getWorld() != world)
boolean abort = false;
final Location playerLoc = onlineUser.getLocation();
if (playerLoc.getWorld() != world)
{
abort = true;
}
final double delta = playerLoc.distanceSquared(loc);
if (delta > chatStore.getRadius())
{
abort = true;
}
if (abort)
{
if (onlineUser.isAuthorized("essentials.chat.spy"))
{
abort = true;
}
final double delta = playerLoc.distanceSquared(loc);
if (delta > chatStore.getRadius())
{
abort = true;
}
if (abort) {
if (onlineUser.isAuthorized("essentials.chat.spy"))
{
type = type.concat(_("chatTypeSpy"));
}
else
{
continue;
}
}
else
{
continue;
}
}
}
String message = String.format(event.getFormat(), type.concat(sender.getDisplayName()), event.getMessage());