summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-08-11 07:08:39 -0700
committerKHobbits <rob@khobbits.co.uk>2011-08-11 07:08:39 -0700
commit6fa2b14d65bdeb8aa799a46025747941548bc9e7 (patch)
treefa318bdb27605b09d2a2801268a6d5f843c6e465
parent93883cfc1231824fcabd061b4c01580cd172dd04 (diff)
parent6ec674d0a345d4fcd91c6a02c0bccc0b18a0106d (diff)
downloadEssentials-6fa2b14d65bdeb8aa799a46025747941548bc9e7.tar
Essentials-6fa2b14d65bdeb8aa799a46025747941548bc9e7.tar.gz
Essentials-6fa2b14d65bdeb8aa799a46025747941548bc9e7.tar.lz
Essentials-6fa2b14d65bdeb8aa799a46025747941548bc9e7.tar.xz
Essentials-6fa2b14d65bdeb8aa799a46025747941548bc9e7.zip
Merge pull request #1 from okamosy/master
added error message
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpay.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java
index 4f52eee58..9be844996 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java
@@ -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"));
}
}
}