Merge pull request #1 from okamosy/master

added error message
This commit is contained in:
KHobbits 2011-08-11 07:08:39 -07:00
commit 6fa2b14d65

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
public class Commandpay extends EssentialsCommand
@ -22,6 +23,7 @@ public class Commandpay extends EssentialsCommand
double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", ""));
Boolean foundUser = false;
for (Player p : server.matchPlayer(args[0]))
{
User u = ess.getUser(p);
@ -30,6 +32,11 @@ public class Commandpay extends EssentialsCommand
continue;
}
user.payUser(u, amount);
foundUser = true;
}
if(foundUser == false) {
throw new NoSuchFieldException(Util.i18n("playerNotFound"));
}
}
}