New permissions: essentials.powertool.append.

This commit is contained in:
KHobbits 2011-12-09 21:42:36 +00:00
parent f99867dd0a
commit c0e903c1f3
4 changed files with 12 additions and 7 deletions

View File

@ -175,7 +175,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
@Override
public int compareTo(final User other)
{
return ChatColor.stripColor(this.getDisplayName()).compareToIgnoreCase(ChatColor.stripColor(other.getDisplayName()));
return this.getName().compareToIgnoreCase(other.getName());
}
@Override
@ -185,14 +185,14 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
return false;
}
return ChatColor.stripColor(this.getDisplayName()).equalsIgnoreCase(ChatColor.stripColor(((User)object).getDisplayName()));
return this.getName().equalsIgnoreCase(((User)object).getName());
}
@Override
public int hashCode()
{
return ChatColor.stripColor(this.getDisplayName()).hashCode();
return this.getName().hashCode();
}
public Boolean canSpawnItem(final int itemId)

View File

@ -58,7 +58,7 @@ public class Commandmail extends EssentialsCommand
}
if (!u.isIgnoredPlayer(user.getName()))
{
u.addMail(ChatColor.stripColor(user.getDisplayName()) + ": " + getFinalArg(args, 2));
u.addMail(user.getName() + ": " + getFinalArg(args, 2));
}
user.sendMessage(_("mailSent"));
return;
@ -69,7 +69,7 @@ public class Commandmail extends EssentialsCommand
{
throw new Exception(_("noPerm","essentials.mail.sendall"));
}
ess.scheduleAsyncDelayedTask(new SendAll(ChatColor.stripColor(user.getDisplayName()) + ": " + getFinalArg(args, 1)));
ess.scheduleAsyncDelayedTask(new SendAll(user.getName() + ": " + getFinalArg(args, 1)));
user.sendMessage(_("mailSent"));
return;
}

View File

@ -24,7 +24,7 @@ public class Commandpowertool extends EssentialsCommand
String command = getFinalArg(args, 0);
// check to see if this is a clear all command
if (command != null && command.equalsIgnoreCase("c:"))
if (command != null && command.equalsIgnoreCase("d:"))
{
user.clearAllPowertools();
user.sendMessage(_("powerToolClearAll"));
@ -76,11 +76,16 @@ public class Commandpowertool extends EssentialsCommand
{
if (command.startsWith("a:"))
{
if (!user.isAuthorized("essentials.powertool.append"))
{
throw new Exception(_("noPerm", "essentials.powertool.append"));
}
command = command.substring(2);
if (powertools.contains(command))
{
throw new Exception(_("powerToolAlreadySet", command, itemName));
}
}
else if (powertools != null && !powertools.isEmpty())
{

View File

@ -240,7 +240,7 @@ commands:
aliases: [pong,eping,epong]
powertool:
description: Assigns a command to the item in hand, {player} will be replaced by the name of the player that you click.
usage: /<command> [l:|a:|r:|c:][command] [arguments]
usage: /<command> [l:|a:|r:|c:|d:][command] [arguments]
aliases: [pt,epowertool,ept]
powertooltoggle:
description: Enables or disables all current powertools