diff --git a/src/main/java/ca/tweetzy/auctionhouse/AuctionHouse.java b/src/main/java/ca/tweetzy/auctionhouse/AuctionHouse.java index 3c23efb..9c8c5f4 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/AuctionHouse.java +++ b/src/main/java/ca/tweetzy/auctionhouse/AuctionHouse.java @@ -102,6 +102,7 @@ public class AuctionHouse extends TweetyPlugin { new CommandSell(), new CommandActive(), new CommandExpired(), + new CommandTransactions(), new CommandSettings() ); diff --git a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandTransactions.java b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandTransactions.java new file mode 100644 index 0000000..9acec3e --- /dev/null +++ b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandTransactions.java @@ -0,0 +1,50 @@ +package ca.tweetzy.auctionhouse.commands; + +import ca.tweetzy.auctionhouse.AuctionHouse; +import ca.tweetzy.auctionhouse.guis.GUIActiveAuctions; +import ca.tweetzy.auctionhouse.guis.transaction.GUITransactionList; +import ca.tweetzy.core.commands.AbstractCommand; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.List; + +/** + * The current file has been created by Kiran Hart + * Date Created: March 23 2021 + * Time Created: 9:29 p.m. + * Usage of any code found within this class is prohibited unless given explicit permission otherwise + */ +public class CommandTransactions extends AbstractCommand { + + public CommandTransactions() { + super(CommandType.PLAYER_ONLY, "transactions"); + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + Player player = (Player) sender; + AuctionHouse.getInstance().getGuiManager().showGUI(player, new GUITransactionList(AuctionHouse.getInstance().getAuctionPlayerManager().getPlayer(player.getUniqueId()))); + return ReturnType.SUCCESS; + } + + @Override + public String getPermissionNode() { + return "auctionhouse.cmd.transactions"; + } + + @Override + public String getSyntax() { + return "transactions"; + } + + @Override + public String getDescription() { + return "Used to open the transactions menu"; + } + + @Override + protected List onTab(CommandSender sender, String... args) { + return null; + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index f857a0c..d68db46 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -23,6 +23,7 @@ permissions: auctionhouse.cmd.active: true auctionhouse.cmd.expired: true auctionhouse.cmd.settings: true + auctionhouse.cmd.transactions: true auctionhouse.cmd: description: Allows the user to use /ah default: op @@ -37,4 +38,7 @@ permissions: default: op auctionhouse.cmd.settings: description: Allows the user to open the in game config editor + default: op + auctionhouse.cmd.transactions: + description: Allows the user to open the transactions menu default: op \ No newline at end of file