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.minimessage.Template;
027
028@CommandDeclaration(command = "plugin",
029        permission = "plots.use",
030        usage = "/plot plugin",
031        aliases = "version",
032        category = CommandCategory.INFO)
033public class PluginCmd extends SubCommand {
034
035    @Override
036    public boolean onCommand(final PlotPlayer<?> player, String[] args) {
037        TaskManager.getPlatformImplementation().taskAsync(() -> {
038            player.sendMessage(
039                    StaticCaption.of("<gray>>> </gray><gold><bold>" + PlotSquared
040                            .platform()
041                            .pluginName() + " <reset><gray>(<gold>Version</gold><gray>: </gray><gold><version></gold><gray>)</gray>"),
042                    Template.of("version", String.valueOf(PlotSquared.get().getVersion()))
043            );
044            player.sendMessage(StaticCaption.of(
045                    "<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>"));
046            player.sendMessage(StaticCaption.of(
047                    "<gray>>> </gray><gold><bold>Wiki<reset><gray>: </gray><gold><click:open_url:https://intellectualsites.github.io/plotsquared-documentation/>https://intellectualsites.github.io/plotsquared-documentation/</gold>"));
048            player.sendMessage(StaticCaption.of(
049                    "<gray>>> </gray><gold><bold>Discord<reset><gray>: </gray><gold><click:open_url:https://discord.gg/intellectualsites>https://discord.gg/intellectualsites</gold>"));
050            player.sendMessage(
051                    StaticCaption.of("<gray>>> </gray><gold><bold>Premium<reset><gray>: <gold><value></gold>"),
052                    Template.of("value", String.valueOf(PremiumVerification.isPremium()))
053            );
054        });
055        return true;
056    }
057
058}