Settings command

This commit is contained in:
Kiran Hart 2021-03-19 00:19:57 -04:00
parent 619fa38fe7
commit 5f21e26b24
3 changed files with 67 additions and 7 deletions

View File

@ -2,10 +2,7 @@ package ca.tweetzy.auctionhouse;
import ca.tweetzy.auctionhouse.api.UpdateChecker;
import ca.tweetzy.auctionhouse.auction.AuctionPlayer;
import ca.tweetzy.auctionhouse.commands.CommandActive;
import ca.tweetzy.auctionhouse.commands.CommandAuctionHouse;
import ca.tweetzy.auctionhouse.commands.CommandExpired;
import ca.tweetzy.auctionhouse.commands.CommandSell;
import ca.tweetzy.auctionhouse.commands.*;
import ca.tweetzy.auctionhouse.listeners.AuctionListeners;
import ca.tweetzy.auctionhouse.listeners.PlayerListeners;
import ca.tweetzy.auctionhouse.managers.AuctionItemManager;
@ -99,7 +96,8 @@ public class AuctionHouse extends TweetyPlugin {
this.commandManager.addCommand(new CommandAuctionHouse()).addSubCommands(
new CommandSell(),
new CommandActive(),
new CommandExpired()
new CommandExpired(),
new CommandSettings()
);
// start the auction tick task

View File

@ -0,0 +1,49 @@
package ca.tweetzy.auctionhouse.commands;
import ca.tweetzy.auctionhouse.AuctionHouse;
import ca.tweetzy.core.commands.AbstractCommand;
import ca.tweetzy.core.configuration.editor.PluginConfigGui;
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 19 2021
* Time Created: 12:17 a.m.
* Usage of any code found within this class is prohibited unless given explicit permission otherwise
*/
public class CommandSettings extends AbstractCommand {
public CommandSettings() {
super(CommandType.PLAYER_ONLY, "settings");
}
@Override
protected ReturnType runCommand(CommandSender sender, String... args) {
Player player = (Player) sender;
AuctionHouse.getInstance().getGuiManager().showGUI(player, new PluginConfigGui(AuctionHouse.getInstance(), AuctionHouse.getInstance().getLocale().getMessage("general.prefix").getMessage()));
return ReturnType.SUCCESS;
}
@Override
protected List<String> onTab(CommandSender sender, String... args) {
return null;
}
@Override
public String getPermissionNode() {
return "auctionhouse.cmd.settings";
}
@Override
public String getSyntax() {
return "settings";
}
@Override
public String getDescription() {
return "Open the in-game config editor";
}
}

View File

@ -1,8 +1,9 @@
name: AuctionHouse
version: maven-version-number
api-version: 1.16
api-version: 1.13
main: ca.tweetzy.auctionhouse.AuctionHouse
description: idfk... sell stuff in a gui
description: Auction House is a premium auction solution for your server.
website: https://tweetzy.ca/
authors: [Kiran Hart]
depend: [Vault]
@ -19,9 +20,21 @@ permissions:
children:
auctionhouse.cmd: true
auctionhouse.cmd.sell: true
auctionhouse.cmd.active: true
auctionhouse.cmd.expired: true
auctionhouse.cmd.settings: true
auctionhouse.cmd:
description: Allows the user to use /ah
default: op
auctionhouse.cmd.sell:
description: Allows the user to sell items in the auction house
default: op
auctionhouse.cmd.active:
description: Allows the user to open the active listings gui through a command
default: op
auctionhouse.cmd.expired:
description: Allows the user to open the expired listings gui through a command
default: op
auctionhouse.cmd.settings:
description: Allows the user to open the in game config editor
default: op