blob: 9be84499689a6a2c2622299650fe27f0abdf40d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
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
{
public Commandpay()
{
super("pay");
}
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
if (args.length < 2)
{
throw new NotEnoughArgumentsException();
}
double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", ""));
Boolean foundUser = false;
for (Player p : server.matchPlayer(args[0]))
{
User u = ess.getUser(p);
if (u.isHidden())
{
continue;
}
user.payUser(u, amount);
foundUser = true;
}
if(foundUser == false) {
throw new NoSuchFieldException(Util.i18n("playerNotFound"));
}
}
}
|