mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-01-24 15:31:19 +01:00
2.12.4
This commit is contained in:
parent
29a0d2c3be
commit
2f2fd08652
@ -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())) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user