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 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<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) voidextractRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY) booleanextractSuggestions(GuiGraphicsExtractor graphics, int mouseX, int mouseY) voidextractUsage(GuiGraphicsExtractor graphics) private List<FormattedCharSequence> fillNodeUsage(SuggestionContext<ClientSuggestionProvider> suggestionContext, Style usageFormat) private @Nullable FormattedCharSequenceformatChat(String text, int offset) private static FormattedCharSequenceformatText(ParseResults<ClientSuggestionProvider> currentParse, String text, int offset) private static FormattedCharSequenceprivate static intgetLastWordIndex(String text) booleanprivate static booleanhasMessageArguments(ParseResults<ClientSuggestionProvider> parseResults) voidhide()booleanbooleankeyPressed(KeyEvent event) booleanmouseClicked(MouseButtonEvent event) booleanmouseScrolled(double scroll) private voidvoidsetAllowHiding(boolean allowHiding) voidsetAllowSuggestions(boolean allowSuggestions) voidsetRestrictions(boolean messagesAllowed, boolean commandsAllowed) voidshowSuggestions(boolean immediateNarration) private List<Suggestion> sortSuggestions(Suggestions suggestions) voidprivate voidupdateUsageInfo(ParseResults<ClientSuggestionProvider> currentParse, 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
-
updateCommandInfo
public void updateCommandInfo() -
hasMessageArguments
-
getLastWordIndex
-
getExceptionMessage
-
updateUsageInfo
private void updateUsageInfo(ParseResults<ClientSuggestionProvider> currentParse, Suggestions suggestions) -
fillNodeUsage
private List<FormattedCharSequence> fillNodeUsage(SuggestionContext<ClientSuggestionProvider> suggestionContext, Style usageFormat) -
recomputeUsageBoxWidth
private void recomputeUsageBoxWidth() -
formatChat
-
calculateSuggestionSuffix
-
formatText
private static FormattedCharSequence formatText(ParseResults<ClientSuggestionProvider> currentParse, String text, int offset) -
extractRenderState
-
extractSuggestions
-
extractUsage
-
getNarrationMessage
-
hasAllowedInput
public boolean hasAllowedInput()
-