summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokamosy <okamosy@gmail.com>2011-08-11 15:03:08 +0100
committerokamosy <okamosy@gmail.com>2011-08-11 15:03:08 +0100
commit6ec674d0a345d4fcd91c6a02c0bccc0b18a0106d (patch)
treee5e5364b03f12f349bbe91ae8d82b68bd6ab15cb
parent576b48c08c4f475bb9a439f3f5d591046751ed56 (diff)
downloadEssentials-6ec674d0a345d4fcd91c6a02c0bccc0b18a0106d.tar
Essentials-6ec674d0a345d4fcd91c6a02c0bccc0b18a0106d.tar.gz
Essentials-6ec674d0a345d4fcd91c6a02c0bccc0b18a0106d.tar.lz
Essentials-6ec674d0a345d4fcd91c6a02c0bccc0b18a0106d.tar.xz
Essentials-6ec674d0a345d4fcd91c6a02c0bccc0b18a0106d.zip
added error message when attempting to pay a user that isn't online
-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"));
}
}
}