diff --git a/src/api/java/baritone/api/utils/Helper.java b/src/api/java/baritone/api/utils/Helper.java index 8ef0d29e..7d962501 100755 --- a/src/api/java/baritone/api/utils/Helper.java +++ b/src/api/java/baritone/api/utils/Helper.java @@ -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); diff --git a/src/api/java/baritone/api/utils/ISchematic.java b/src/api/java/baritone/api/utils/ISchematic.java index a60ca846..2adcbdd5 100644 --- a/src/api/java/baritone/api/utils/ISchematic.java +++ b/src/api/java/baritone/api/utils/ISchematic.java @@ -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 diff --git a/src/api/java/baritone/api/utils/command/BaritoneChatControl.java b/src/api/java/baritone/api/utils/command/BaritoneChatControl.java index 84b6f927..7c3de5ad 100644 --- a/src/api/java/baritone/api/utils/command/BaritoneChatControl.java +++ b/src/api/java/baritone/api/utils/command/BaritoneChatControl.java @@ -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. + *
+ * 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. + *
+ * 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) {