Class CommandSuggestions
java.lang.Object
net.minecraft.client.gui.components.CommandSuggestions
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate final booleanprivate static final Componentprivate booleanprivate final booleanprivate final List<FormattedCharSequence> private intprivate intprivate @Nullable com.mojang.brigadier.ParseResults<ClientSuggestionProvider> private booleanprivate booleanprivate final intprivate final Fontprivate final EditBoxprivate booleanstatic final intprivate final intprivate static final Styleprivate static final Componentprivate booleanprivate final Minecraftprivate final booleanprivate @Nullable CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> private final Screenprivate final intprivate @Nullable CommandSuggestions.SuggestionsListprivate static final Stylestatic final Stylestatic final intprivate static final Pattern -
Constructor Summary
ConstructorsConstructorDescriptionCommandSuggestions(Minecraft minecraft, Screen screen, EditBox input, Font font, boolean commandsOnly, boolean onlyShowIfCursorPastError, int lineStartOffset, int suggestionLineLimit, boolean anchorToBottom, int fillColor) -
Method Summary
Modifier and TypeMethodDescriptionprivate static @Nullable StringcalculateSuggestionSuffix(String contents, String suggestion) private List<FormattedCharSequence> fillNodeUsage(com.mojang.brigadier.context.SuggestionContext<ClientSuggestionProvider> suggestionContext, Style usageFormat) private @Nullable FormattedCharSequenceformatChat(String text, int offset) private static FormattedCharSequenceformatText(com.mojang.brigadier.ParseResults<ClientSuggestionProvider> currentParse, String text, int offset) private static FormattedCharSequencegetExceptionMessage(com.mojang.brigadier.exceptions.CommandSyntaxException e) private static intgetLastWordIndex(String text) booleanprivate static booleanhasMessageArguments(com.mojang.brigadier.ParseResults<ClientSuggestionProvider> parseResults) voidhide()booleanbooleankeyPressed(KeyEvent event) booleanmouseClicked(MouseButtonEvent event) booleanmouseScrolled(double scroll) private voidvoidrender(GuiGraphics graphics, int mouseX, int mouseY) booleanrenderSuggestions(GuiGraphics graphics, int mouseX, int mouseY) voidrenderUsage(GuiGraphics graphics) voidsetAllowHiding(boolean allowHiding) voidsetAllowSuggestions(boolean allowSuggestions) voidsetRestrictions(boolean messagesAllowed, boolean commandsAllowed) voidshowSuggestions(boolean immediateNarration) private List<com.mojang.brigadier.suggestion.Suggestion> sortSuggestions(com.mojang.brigadier.suggestion.Suggestions suggestions) voidprivate voidupdateUsageInfo(com.mojang.brigadier.ParseResults<ClientSuggestionProvider> currentParse, com.mojang.brigadier.suggestion.Suggestions suggestions)
-
Field Details
-
WHITESPACE_PATTERN
-
UNPARSED_STYLE
-
LITERAL_STYLE
-
USAGE_FORMAT
-
ARGUMENT_STYLES
-
LINE_HEIGHT
public static final int LINE_HEIGHT- See Also:
-
USAGE_OFFSET_FROM_BOTTOM
public static final int USAGE_OFFSET_FROM_BOTTOM- See Also:
-
COMMANDS_NOT_ALLOWED_TEXT
-
MESSAGES_NOT_ALLOWED_TEXT
-
minecraft
-
screen
-
input
-
font
-
commandsOnly
private final boolean commandsOnly -
onlyShowIfCursorPastError
private final boolean onlyShowIfCursorPastError -
lineStartOffset
private final int lineStartOffset -
suggestionLineLimit
private final int suggestionLineLimit -
anchorToBottom
private final boolean anchorToBottom -
fillColor
private final int fillColor -
commandUsage
-
commandUsagePosition
private int commandUsagePosition -
commandUsageWidth
private int commandUsageWidth -
currentParse
-
pendingSuggestions
-
suggestions
-
currentParseIsCommand
private boolean currentParseIsCommand -
currentParseIsMessage
private boolean currentParseIsMessage -
allowSuggestions
private boolean allowSuggestions -
keepSuggestions
private boolean keepSuggestions -
allowHiding
private boolean allowHiding -
messagesAllowed
private boolean messagesAllowed -
commandsAllowed
private boolean commandsAllowed
-
-
Constructor Details
-
CommandSuggestions
-
-
Method Details
-
setAllowSuggestions
public void setAllowSuggestions(boolean allowSuggestions) -
setAllowHiding
public void setAllowHiding(boolean allowHiding) -
setRestrictions
public void setRestrictions(boolean messagesAllowed, boolean commandsAllowed) -
keyPressed
-
mouseScrolled
public boolean mouseScrolled(double scroll) -
mouseClicked
-
showSuggestions
public void showSuggestions(boolean immediateNarration) -
isVisible
public boolean isVisible() -
getUsageNarration
-
hide
public void hide() -
sortSuggestions
private List<com.mojang.brigadier.suggestion.Suggestion> sortSuggestions(com.mojang.brigadier.suggestion.Suggestions suggestions) -
updateCommandInfo
public void updateCommandInfo() -
hasMessageArguments
private static boolean hasMessageArguments(com.mojang.brigadier.ParseResults<ClientSuggestionProvider> parseResults) -
getLastWordIndex
-
getExceptionMessage
private static FormattedCharSequence getExceptionMessage(com.mojang.brigadier.exceptions.CommandSyntaxException e) -
updateUsageInfo
private void updateUsageInfo(com.mojang.brigadier.ParseResults<ClientSuggestionProvider> currentParse, com.mojang.brigadier.suggestion.Suggestions suggestions) -
fillNodeUsage
private List<FormattedCharSequence> fillNodeUsage(com.mojang.brigadier.context.SuggestionContext<ClientSuggestionProvider> suggestionContext, Style usageFormat) -
recomputeUsageBoxWidth
private void recomputeUsageBoxWidth() -
formatChat
-
calculateSuggestionSuffix
-
formatText
private static FormattedCharSequence formatText(com.mojang.brigadier.ParseResults<ClientSuggestionProvider> currentParse, String text, int offset) -
render
-
renderSuggestions
-
renderUsage
-
getNarrationMessage
-
hasAllowedInput
public boolean hasAllowedInput()
-