This commit is contained in:
Kiran Hart 2021-06-10 12:07:20 -04:00
parent 29a0d2c3be
commit 2f2fd08652
2 changed files with 14 additions and 0 deletions

View File

@ -256,6 +256,16 @@ public class AuctionAPI {
return string.substring(0, index) + replacement + string.substring(index + substring.length());
}
public List<String> getCommandFlags(String... args) {
List<String> flags = new ArrayList<>();
for (String arg : args) {
if (arg.startsWith("-") && arg.length() >= 2) {
flags.add(arg.substring(0, 2));
}
}
return flags;
}
public void endAuction(AuctionItem item) {
// check if the auction item owner is the same as the highest bidder
if (item.getOwner().equals(item.getHighestBidder())) {

View File

@ -100,6 +100,10 @@ public class CommandSell extends AbstractCommand {
return ReturnType.FAILURE;
}
// Special command arguments
List<String> commandFlags = AuctionAPI.getInstance().getCommandFlags(args);
// TODO Redo the selling command to fit the command flags
if (args.length <= 1) {
if (!NumberUtils.isDouble(args[0])) {
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", args[0]).sendPrefixedMessage(player);