section check for the convert command, added the convert command perms to the plugin.yml

This commit is contained in:
Kiran Hart 2021-03-29 17:11:40 -04:00
parent 9ef418f457
commit fd48219c03
2 changed files with 9 additions and 0 deletions

View File

@ -34,6 +34,11 @@ public class CommandConvert extends AbstractCommand {
ConfigurationSection activeSection = AuctionHouse.getInstance().getData().getConfigurationSection("active");
ConfigurationSection expiredSection = AuctionHouse.getInstance().getData().getConfigurationSection("expired");
if (activeSection == null || expiredSection == null) {
AuctionHouse.getInstance().getLocale().newMessage(TextUtils.formatText("&4Active/Expired section(s) could not be found, have you ran the conversion command already?")).sendPrefixedMessage(sender);
return;
}
if (activeSection != null && activeSection.getKeys(false).size() != 0) {
activeSection.getKeys(false).forEach(key -> AuctionHouse.getInstance().getAuctionItemManager().addItem(new AuctionItem(
UUID.fromString(Objects.requireNonNull(AuctionHouse.getInstance().getData().getString("active." + key + ".owner"))),

View File

@ -25,6 +25,7 @@ permissions:
auctionhouse.cmd.settings: true
auctionhouse.cmd.transactions: true
auctionhouse.cmd.search: true
auctionhouse.cmd.convert: true
auctionhouse.cmd:
description: Allows the user to use /ah
default: op
@ -45,4 +46,7 @@ permissions:
default: op
auctionhouse.cmd.search:
description: Allows the user to search for auction items.
default: op
auctionhouse.cmd.convert:
description: Allows the user to run conversion command
default: op