use of com.earth2me.essentials.commands.NoChargeException in project Essentials by EssentialsX.
the class Commandspawn method run.
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
if (args.length > 0 && user.isAuthorized("essentials.spawn.others")) {
final User otherUser = getPlayer(server, user, args, 0);
respawn(user.getSource(), user, otherUser, charge);
if (!otherUser.equals(user)) {
otherUser.sendMessage(tl("teleportAtoB", user.getDisplayName(), "spawn"));
}
} else {
respawn(user.getSource(), user, user, charge);
}
throw new NoChargeException();
}
use of com.earth2me.essentials.commands.NoChargeException in project Essentials by drtshock.
the class EconomyTest method runConsoleCommand.
private void runConsoleCommand(String command, String[] args) throws Exception {
IEssentialsCommand cmd;
CommandSender sender = server.getConsoleSender();
try {
cmd = (IEssentialsCommand) Essentials.class.getClassLoader().loadClass("com.earth2me.essentials.commands.Command" + command).newInstance();
cmd.setEssentials(ess);
cmd.run(server, new CommandSource(sender), command, null, args);
} catch (NoChargeException ex) {
}
}
use of com.earth2me.essentials.commands.NoChargeException in project Essentials by drtshock.
the class Commandspawn method run.
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
if (args.length > 0 && user.isAuthorized("essentials.spawn.others")) {
final User otherUser = getPlayer(server, user, args, 0);
respawn(user.getSource(), user, otherUser, charge);
if (!otherUser.equals(user)) {
otherUser.sendMessage(tl("teleportAtoB", user.getDisplayName(), "spawn"));
}
} else {
respawn(user.getSource(), user, user, charge);
}
throw new NoChargeException();
}
use of com.earth2me.essentials.commands.NoChargeException in project Essentials by drtshock.
the class ToggleTest method runCommand.
private void runCommand(String command, User user, String[] args) throws Exception {
IEssentialsCommand cmd;
try {
cmd = (IEssentialsCommand) Essentials.class.getClassLoader().loadClass("com.earth2me.essentials.commands.Command" + command).newInstance();
cmd.setEssentials(ess);
cmd.run(server, user, command, null, args);
} catch (NoChargeException ex) {
}
}
use of com.earth2me.essentials.commands.NoChargeException in project Essentials by EssentialsX.
the class EconomyTest method runCommand.
private void runCommand(String command, User user, String[] args) throws Exception {
IEssentialsCommand cmd;
try {
cmd = (IEssentialsCommand) Essentials.class.getClassLoader().loadClass("com.earth2me.essentials.commands.Command" + command).newInstance();
cmd.setEssentials(ess);
cmd.run(server, user, command, null, args);
} catch (NoChargeException ex) {
}
}
Aggregations