mirror of
https://github.com/kiranhart/Auction-House.git
synced 2024-11-23 05:35:16 +01:00
stat command
Took 56 minutes
This commit is contained in:
parent
f677e7d5fc
commit
1e9efecefe
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user