summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorementalo <ementalo@gmx.co.uk>2011-07-08 10:37:40 +0100
committerementalo <ementalo@gmx.co.uk>2011-07-08 10:37:40 +0100
commit7ed57bc291b990f44ce5d535f9865221f77d07cf (patch)
treeeff3b9dd59c7bd1038ca0056d632625b6132ce9d
parentcb5ab32be6e300183bf36ef1a5187a758106c444 (diff)
downloadEssentials-7ed57bc291b990f44ce5d535f9865221f77d07cf.tar
Essentials-7ed57bc291b990f44ce5d535f9865221f77d07cf.tar.gz
Essentials-7ed57bc291b990f44ce5d535f9865221f77d07cf.tar.lz
Essentials-7ed57bc291b990f44ce5d535f9865221f77d07cf.tar.xz
Essentials-7ed57bc291b990f44ce5d535f9865221f77d07cf.zip
/eco offline players
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandeco.java31
1 files changed, 15 insertions, 16 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java
index 085fac900..618583cfd 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java
@@ -2,7 +2,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.Essentials;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
@@ -56,28 +55,28 @@ public class Commandeco extends EssentialsCommand
}
else
{
- for (Player p : server.matchPlayer(args[1]))
+ User u = ess.getUser(args[1]);
+ if (u == null)
{
- User u = ess.getUser(p);
- switch (cmd)
- {
- case GIVE:
- u.giveMoney(amount);
- break;
+ u = ess.getOfflineUser(args[0]);
+ }
+ switch (cmd)
+ {
+ case GIVE:
+ u.giveMoney(amount);
+ break;
- case TAKE:
- u.takeMoney(amount);
- break;
+ case TAKE:
+ u.takeMoney(amount);
+ break;
- case RESET:
- u.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
- break;
- }
+ case RESET:
+ u.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
+ break;
}
}
}
-
private enum EcoCommands
{
GIVE, TAKE, RESET