Merge pull request #956 from LoganDark/commands

Pulling in logandark's uncommitted changes to commands staging
This commit is contained in:
Leijurv 2019-09-19 21:49:27 -07:00 committed by GitHub
commit fc43ef9308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public interface Helper {
* @param color The color to print that message in
*/
default void logDirect(String message, TextFormatting color) {
Arrays.stream(message.split("\\n")).forEach(line -> {
Arrays.stream(message.split("\n")).forEach(line -> {
ITextComponent component = new TextComponentString(line.replace("\t", " "));
component.getStyle().setColor(color);
logDirect(component);

View File

@ -23,7 +23,7 @@ import net.minecraft.util.EnumFacing;
import java.util.List;
/**
* Basic representation of a schematic. Provides the dimensions and the desired statefor a given position relative to
* Basic representation of a schematic. Provides the dimensions and the desired state for a given position relative to
* the origin.
*
* @author leijurv

View File

@ -52,6 +52,18 @@ public class BaritoneChatControl implements Helper, AbstractGameEventListener {
public final IBaritone baritone;
public final IPlayerContext ctx;
public final Settings settings = BaritoneAPI.getSettings();
/**
* In certain cases chat components need to execute commands for you. For example, the paginator automatically runs
* commands when you click the forward and back arrows to show you the previous/next page.
* <p>
* If the prefix is changed in the meantime, then the command will go to chat. That's no good. So here's a permanent
* prefix that forces a command to run, regardless of the current prefix, chat/prefix control being enabled, etc.
* <p>
* If used right (by both developers and users), it should be impossible to expose a command accidentally to the
* server. As a rule of thumb, if you have a clickable chat component, always use this prefix. If you're suggesting
* a command (a component that puts text into your text box, or something else), use {@link Settings#prefix}.
*/
public static String FORCE_COMMAND_PREFIX = String.format("<<%s>>", UUID.randomUUID().toString());
public BaritoneChatControl(IBaritone baritone) {