mirror of
https://github.com/essentials/Essentials.git
synced 2025-09-02 11:13:55 +02:00
Fix interface params to match with the implementation method
This commit is contained in:
@@ -22,7 +22,7 @@ public interface IUserMap extends IReload
|
||||
|
||||
File getUserFile(final String name) throws InvalidNameException;
|
||||
|
||||
IUser matchUser(final String name, final boolean includeHidden, final boolean onlineOnly) throws TooManyMatchesException;
|
||||
IUser matchUser(final String name, final boolean includeHidden, final boolean includeOffline) throws TooManyMatchesException;
|
||||
|
||||
Set<IUser> matchUsers(final String name, final boolean includeHidden, final boolean onlineOnly);
|
||||
Set<IUser> matchUsers(final String name, final boolean includeHidden, final boolean includeOffline);
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ public class Commandafk extends EssentialsCommand
|
||||
{
|
||||
if (args.length > 0 && Permissions.AFK_OTHERS.isAuthorized(user))
|
||||
{
|
||||
IUser afkUser = ess.getUserMap().matchUser(args[0], false, true);
|
||||
IUser afkUser = ess.getUserMap().matchUser(args[0], false, false);
|
||||
if (afkUser != null)
|
||||
{
|
||||
toggleAfk(afkUser);
|
||||
|
@@ -16,7 +16,7 @@ public class Commandbalance extends EssentialsCommand
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
sender.sendMessage(_("balance", Util.displayCurrency(ess.getUserMap().matchUser(args[0], true, false).getMoney(), ess)));
|
||||
sender.sendMessage(_("balance", Util.displayCurrency(ess.getUserMap().matchUser(args[0], true, true).getMoney(), ess)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -25,7 +25,7 @@ public class Commandbalance extends EssentialsCommand
|
||||
final double bal = (args.length < 1
|
||||
|| !Permissions.BALANCE_OTHERS.isAuthorized(user)
|
||||
? user
|
||||
: ess.getUserMap().matchUser(args[0], true, false)).getMoney();
|
||||
: ess.getUserMap().matchUser(args[0], true, true)).getMoney();
|
||||
user.sendMessage(_("balance", Util.displayCurrency(bal, ess)));
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ public class Commandburn extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
for (Player p : ess.getUserMap().matchUsers(args[0], false, true))
|
||||
for (Player p : ess.getUserMap().matchUsers(args[0], false, false))
|
||||
{
|
||||
p.setFireTicks(Integer.parseInt(args[1]) * 20);
|
||||
sender.sendMessage(_("burnMsg", p.getDisplayName(), Integer.parseInt(args[1])));
|
||||
|
@@ -88,7 +88,7 @@ public class Commandexp extends EssentialsCommand
|
||||
private void showMatch(final CommandSender sender, final String match) throws NotEnoughArgumentsException
|
||||
{
|
||||
boolean foundUser = false;
|
||||
for (IUser matchPlayer : ess.getUserMap().matchUsers(match, false, true))
|
||||
for (IUser matchPlayer : ess.getUserMap().matchUsers(match, false, false))
|
||||
{
|
||||
foundUser = true;
|
||||
showExp(sender, matchPlayer);
|
||||
@@ -102,7 +102,7 @@ public class Commandexp extends EssentialsCommand
|
||||
private void expMatch(final CommandSender sender, final String match, final String amount, final boolean toggle) throws NotEnoughArgumentsException
|
||||
{
|
||||
boolean foundUser = false;
|
||||
for (IUser matchPlayer : ess.getUserMap().matchUsers(match, false, true))
|
||||
for (IUser matchPlayer : ess.getUserMap().matchUsers(match, false, false))
|
||||
{
|
||||
setExp(sender, matchPlayer, amount, toggle);
|
||||
foundUser = true;
|
||||
|
@@ -34,7 +34,7 @@ public class Commandext extends EssentialsCommand
|
||||
|
||||
private void extinguishPlayers(final CommandSender sender, final String name) throws Exception
|
||||
{
|
||||
for (Player matchPlayer : ess.getUserMap().matchUsers(name, true, false))
|
||||
for (Player matchPlayer : ess.getUserMap().matchUsers(name, false, false))
|
||||
{
|
||||
matchPlayer.setFireTicks(0);
|
||||
sender.sendMessage(_("extinguishOthers", matchPlayer.getDisplayName()));
|
||||
|
@@ -28,7 +28,7 @@ public class Commandfeed extends EssentialsCommand
|
||||
|
||||
private void feedOtherPlayers(final CommandSender sender, final String name)
|
||||
{
|
||||
final Set<IUser> users = ess.getUserMap().matchUsers(name, false, true);
|
||||
final Set<IUser> users = ess.getUserMap().matchUsers(name, false, false);
|
||||
if (users.isEmpty())
|
||||
{
|
||||
sender.sendMessage(_("playerNotFound"));
|
||||
|
@@ -41,7 +41,7 @@ public class Commandfly extends EssentialsCommand
|
||||
|
||||
private void flyOtherPlayers(final Server server, final CommandSender sender, final String[] args)
|
||||
{
|
||||
for (Player matchPlayer : ess.getUserMap().matchUsers(args[0],true,true))
|
||||
for (Player matchPlayer : ess.getUserMap().matchUsers(args[0],false,false))
|
||||
{
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
@@ -37,7 +37,7 @@ public class Commandgamemode extends EssentialsCommand
|
||||
|
||||
private void gamemodeOtherPlayers(final CommandSender sender, final String args[])
|
||||
{
|
||||
for (Player player : ess.getUserMap().matchUsers(args[0], false, true))
|
||||
for (Player player : ess.getUserMap().matchUsers(args[0], false, false))
|
||||
{
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
@@ -45,7 +45,7 @@ public class Commandheal extends EssentialsCommand
|
||||
|
||||
private void healOtherPlayers(final CommandSender sender, final String name)
|
||||
{
|
||||
final Set<IUser> users = ess.getUserMap().matchUsers(name, false, true);
|
||||
final Set<IUser> users = ess.getUserMap().matchUsers(name, false, false);
|
||||
if (users.isEmpty())
|
||||
{
|
||||
sender.sendMessage(_("playerNotFound"));
|
||||
|
@@ -18,7 +18,7 @@ public class Commandkill extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
for (Player matchPlayer : ess.getUserMap().matchUsers(args[0], false, true))
|
||||
for (Player matchPlayer : ess.getUserMap().matchUsers(args[0], false, false))
|
||||
{
|
||||
final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Short.MAX_VALUE);
|
||||
server.getPluginManager().callEvent(ede);
|
||||
|
@@ -28,7 +28,7 @@ public class Commandlightning extends EssentialsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if (ess.getUserMap().matchUsers(args[0], false, true).isEmpty())
|
||||
if (ess.getUserMap().matchUsers(args[0], false, false).isEmpty())
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class Commandlightning extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
|
||||
for (Player matchPlayer : ess.getUserMap().matchUsers(args[0], false, true))
|
||||
for (Player matchPlayer : ess.getUserMap().matchUsers(args[0], false, false))
|
||||
{
|
||||
sender.sendMessage(_("lightningUse", matchPlayer.getDisplayName()));
|
||||
final LightningStrike strike = matchPlayer.getWorld().strikeLightningEffect(matchPlayer.getLocation());
|
||||
|
@@ -37,7 +37,7 @@ public class Commandmail extends EssentialsCommand
|
||||
throw new Exception(_("noPerm", "essentials.mail.send"));
|
||||
}
|
||||
|
||||
Player player = ess.getUserMap().matchUser(args[1], true, false);
|
||||
Player player = ess.getUserMap().matchUser(args[1], true, true);
|
||||
IUser u;
|
||||
if (player != null)
|
||||
{
|
||||
@@ -45,7 +45,7 @@ public class Commandmail extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
u = ess.getUserMap().matchUser(args[1], true, false);
|
||||
u = ess.getUserMap().matchUser(args[1], true, true);
|
||||
}
|
||||
if (u == null)
|
||||
{
|
||||
@@ -92,7 +92,7 @@ public class Commandmail extends EssentialsCommand
|
||||
}
|
||||
else if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
Player player = ess.getUserMap().matchUser(args[1], true, false);
|
||||
Player player = ess.getUserMap().matchUser(args[1], true, true);
|
||||
IUser u;
|
||||
if (player != null)
|
||||
{
|
||||
@@ -100,7 +100,7 @@ public class Commandmail extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
u = ess.getUserMap().matchUser(args[1], true, false);
|
||||
u = ess.getUserMap().matchUser(args[1], true, true);
|
||||
}
|
||||
if (u == null)
|
||||
{
|
||||
@@ -117,7 +117,7 @@ public class Commandmail extends EssentialsCommand
|
||||
else if (args.length >= 2)
|
||||
{
|
||||
//allow sending from console without "send" argument, since it's the only thing the console can do
|
||||
Player player = ess.getUserMap().matchUser(args[0], true, false);
|
||||
Player player = ess.getUserMap().matchUser(args[0], true, true);
|
||||
IUser u;
|
||||
if (player != null)
|
||||
{
|
||||
@@ -125,7 +125,7 @@ public class Commandmail extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
u = ess.getUserMap().matchUser(args[0], true, false);
|
||||
u = ess.getUserMap().matchUser(args[0], true, true);
|
||||
}
|
||||
if (u == null)
|
||||
{
|
||||
|
@@ -25,7 +25,7 @@ public class Commandpay extends EssentialsCommand
|
||||
double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", ""));
|
||||
|
||||
boolean foundUser = false;
|
||||
for (Player p : ess.getUserMap().matchUsers(args[0], false, false))
|
||||
for (Player p : ess.getUserMap().matchUsers(args[0], false, true))
|
||||
{
|
||||
user.payUser(p.getUser(), amount);
|
||||
Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), p.getName(), new Trade(amount, ess), user.getLocation(), ess);
|
||||
|
@@ -37,7 +37,7 @@ public class Commandwarp extends EssentialsCommand
|
||||
IUser otherUser = null;
|
||||
if (args.length == 2 && Permissions.WARP_OTHERS.isAuthorized(user))
|
||||
{
|
||||
otherUser = ess.getUserMap().matchUser(args[1],Permissions.WARP_HIDDEN.isAuthorized(user), true);
|
||||
otherUser = ess.getUserMap().matchUser(args[1],Permissions.WARP_HIDDEN.isAuthorized(user), false);
|
||||
if (otherUser == null)
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
@@ -58,7 +58,7 @@ public class Commandwarp extends EssentialsCommand
|
||||
warpList(sender, args);
|
||||
throw new NoChargeException();
|
||||
}
|
||||
IUser otherUser = ess.getUserMap().matchUser(args[1],Permissions.WARP_HIDDEN.isAuthorized(sender), true);
|
||||
IUser otherUser = ess.getUserMap().matchUser(args[1],Permissions.WARP_HIDDEN.isAuthorized(sender), false);
|
||||
if (otherUser == null)
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
|
Reference in New Issue
Block a user