stat command

Took 56 minutes
This commit is contained in:
Kiran Hart 2022-09-22 21:39:10 -04:00
parent f677e7d5fc
commit 1e9efecefe
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3

View File

@ -0,0 +1,60 @@
package ca.tweetzy.auctionhouse.commands;
import ca.tweetzy.auctionhouse.AuctionHouse;
import ca.tweetzy.auctionhouse.auction.AuctionPlayer;
import ca.tweetzy.auctionhouse.guis.statistics.GUIStatisticViewSelect;
import ca.tweetzy.core.commands.AbstractCommand;
import ca.tweetzy.core.utils.TextUtils;
import org.bukkit.Bukkit;
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 15 2021
* Time Created: 4:32 p.m.
* Usage of any code found within this class is prohibited unless given explicit permission otherwise
*/
public class CommandStats extends AbstractCommand {
public CommandStats() {
super(CommandType.PLAYER_ONLY, "stats");
}
@Override
protected ReturnType runCommand(CommandSender sender, String... args) {
Player player = (Player) sender;
if (CommandMiddleware.handle(player) == ReturnType.FAILURE) return ReturnType.FAILURE;
if (AuctionHouse.getInstance().getAuctionPlayerManager().getPlayer(player.getUniqueId()) == null) {
AuctionHouse.getInstance().getLocale().newMessage(TextUtils.formatText("&cCould not find auction player instance for&f: &e" + player.getName() + "&c creating one now.")).sendPrefixedMessage(Bukkit.getConsoleSender());
AuctionHouse.getInstance().getAuctionPlayerManager().addPlayer(new AuctionPlayer(player));
}
AuctionHouse.getInstance().getGuiManager().showGUI(player, new GUIStatisticViewSelect(AuctionHouse.getInstance().getAuctionPlayerManager().getPlayer(player.getUniqueId())));
return ReturnType.SUCCESS;
}
@Override
public String getPermissionNode() {
return "auctionhouse.cmd.stats";
}
@Override
public String getSyntax() {
return AuctionHouse.getInstance().getLocale().getMessage("commands.syntax.stats").getMessage();
}
@Override
public String getDescription() {
return AuctionHouse.getInstance().getLocale().getMessage("commands.description.stats").getMessage();
}
@Override
protected List<String> onTab(CommandSender sender, String... args) {
return null;
}
}