Finally all commands translated.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1471 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-05-15 01:30:54 +00:00
parent c107f7ed66
commit 5eeb020f01
21 changed files with 166 additions and 75 deletions

View file

@ -7,6 +7,7 @@ import org.bukkit.command.CommandSender;
import com.earth2me.essentials.Essentials;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.logging.Logger;
@ -27,11 +28,11 @@ public abstract class EssentialsCommand implements IEssentialsCommand
return name;
}
protected User getPlayer(Server server, String[] args, int pos) throws IndexOutOfBoundsException, NoSuchFieldException
protected User getPlayer(Server server, String[] args, int pos) throws NoSuchFieldException, NotEnoughArgumentsException
{
if (args.length <= pos) throw new IndexOutOfBoundsException("§cInvalid command syntax. Did you forget an argument?");
if (args.length <= pos) throw new NotEnoughArgumentsException();
List<Player> matches = server.matchPlayer(args[pos]);
if (matches.size() < 1) throw new NoSuchFieldException("§cNo matching players could be found.");
if (matches.size() < 1) throw new NoSuchFieldException(Util.i18n("noPlayerFound"));
for (Player p : matches)
{
if (p.getDisplayName().startsWith(args[pos]))
@ -61,7 +62,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
{
throw new Exception("Only in-game players can use " + commandLabel + ".");
throw new Exception(Util.format("onlyPlayers", commandLabel));
}
public static String getFinalArg(String[] args, int start)