001/*
002 * This file is part of Baritone.
003 *
004 * Baritone is free software: you can redistribute it and/or modify
005 * it under the terms of the GNU Lesser General Public License as published by
006 * the Free Software Foundation, either version 3 of the License, or
007 * (at your option) any later version.
008 *
009 * Baritone is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012 * GNU Lesser General Public License for more details.
013 *
014 * You should have received a copy of the GNU Lesser General Public License
015 * along with Baritone.  If not, see <https://www.gnu.org/licenses/>.
016 */
017
018package baritone.api.command;
019
020import baritone.api.Settings;
021
022import java.util.UUID;
023
024/**
025 * @author Brady
026 * @since 9/26/2019
027 */
028public interface IBaritoneChatControl {
029
030    /**
031     * In certain cases chat components need to execute commands for you. For example, the paginator automatically runs
032     * commands when you click the forward and back arrows to show you the previous/next page.
033     * <p>
034     * If the prefix is changed in the meantime, then the command will go to chat. That's no good. So here's a permanent
035     * prefix that forces a command to run, regardless of the current prefix, chat/prefix control being enabled, etc.
036     * <p>
037     * If used right (by both developers and users), it should be impossible to expose a command accidentally to the
038     * server. As a rule of thumb, if you have a clickable chat component, always use this prefix. If you're suggesting
039     * a command (a component that puts text into your text box, or something else), use {@link Settings#prefix}.
040     */
041    String FORCE_COMMAND_PREFIX = String.format("<<%s>>", UUID.randomUUID().toString());
042}