001/*
002 * PlotSquared, a land and world management plugin for Minecraft.
003 * Copyright (C) IntellectualSites <https://intellectualsites.com>
004 * Copyright (C) IntellectualSites team and contributors
005 *
006 * This program is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * This program is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU General Public License for more details.
015 *
016 * You should have received a copy of the GNU General Public License
017 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
018 */
019package com.plotsquared.core.command;
020
021import com.plotsquared.core.PlotSquared;
022import com.plotsquared.core.configuration.caption.StaticCaption;
023import com.plotsquared.core.player.PlotPlayer;
024import com.plotsquared.core.util.PremiumVerification;
025import com.plotsquared.core.util.task.TaskManager;
026import net.kyori.adventure.text.Component;
027import net.kyori.adventure.text.minimessage.tag.Tag;
028import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
029
030@CommandDeclaration(command = "plugin",
031        permission = "plots.use",
032        usage = "/plot plugin",
033        aliases = "version",
034        category = CommandCategory.INFO)
035public class PluginCmd extends SubCommand {
036
037    @Override
038    public boolean onCommand(final PlotPlayer<?> player, String[] args) {
039        TaskManager.getPlatformImplementation().taskAsync(() -> {
040            player.sendMessage(
041                    StaticCaption.of("<gray>>> </gray><gold><bold>" + PlotSquared
042                            .platform()
043                            .pluginName() + " <reset><gray>(<gold>Version</gold><gray>: </gray><gold><version></gold><gray>)</gray>"),
044                    TagResolver.resolver("version", Tag.inserting(Component.text(String.valueOf(PlotSquared.get().getVersion()))))
045            );
046            player.sendMessage(StaticCaption.of(
047                    "<gray>>> </gray><gold><bold>Authors<reset><gray>: </gray><gold>Citymonstret </gold><gray>& </gray><gold>Empire92 </gold><gray>& </gray><gold>MattBDev </gold><gray>& </gray><gold>dordsor21 </gold><gray>& </gray><gold>NotMyFault </gold><gray>& </gray><gold>SirYwell</gold>"));
048            player.sendMessage(StaticCaption.of(
049                    "<gray>>> </gray><gold><bold>Wiki<reset><gray>: </gray><gold><click:open_url:https://intellectualsites.gitbook.io/plotsquared/>https://intellectualsites.gitbook.io/plotsquared/</gold>"));
050            player.sendMessage(StaticCaption.of(
051                    "<gray>>> </gray><gold><bold>Discord<reset><gray>: </gray><gold><click:open_url:https://discord.gg/intellectualsites>https://discord.gg/intellectualsites</gold>"));
052            player.sendMessage(
053                    StaticCaption.of("<gray>>> </gray><gold><bold>Premium<reset><gray>: <gold><value></gold>"),
054                    TagResolver.resolver("value", Tag.inserting(Component.text(PremiumVerification.isPremium())))
055            );
056        });
057        return true;
058    }
059
060}