Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Added "/qs amount [price/amount]" command
Browse files Browse the repository at this point in the history
Closes #166
  • Loading branch information
KaiKikuchi committed Mar 18, 2018
1 parent 661771c commit ba41378
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/org/maxgamer/quickshop/Command/QS.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,25 @@ private void create(CommandSender sender, String[] args) {
}
return;
}

private void amount(CommandSender sender, String[] args) {
if (args.length < 2) {
sender.sendMessage("Missing amount");
return;
}

if (sender instanceof Player) {
final Player player = (Player) sender;
if (!plugin.getShopManager().getActions().containsKey(player.getUniqueId())) {
sender.sendMessage("You do not have any pending action!");
return;
}
plugin.getShopManager().handleChat(player, args[0]);
} else {
sender.sendMessage("This command can't be run by console");
}
return;
}

private void setBuy(CommandSender sender) {
if (sender instanceof Player && sender.hasPermission("quickshop.create.buy")) {
Expand Down Expand Up @@ -510,6 +529,9 @@ public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
} else if (subArg.startsWith("create")) {
create(sender, args);
return true;
} else if (subArg.startsWith("amount")) {
amount(sender, args);
return true;
} else if (subArg.startsWith("buy")) {
setBuy(sender);
return true;
Expand Down

0 comments on commit ba41378

Please sign in to comment.