Package net.minecraft.client.gui.screen
Class CommandSuggestor
java.lang.Object
net.minecraft.client.gui.screen.CommandSuggestor
@Environment(CLIENT) public class CommandSuggestor extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCommandSuggestor.SuggestionWindow -
Field Summary
Fields Modifier and Type Field Description private static PatternBACKSLASH_S_PATTERNprivate booleanchatScreenSizedprivate MinecraftClientclientprivate intcolorprivate booleancompletingSuggestionsprivate static Stylefield_25885private static Stylefield_25886private static List<Style>field_25887private intinWindowIndexOffsetprivate intmaxSuggestionSizeprivate List<OrderedText>messagesprivate Screenownerprivate com.mojang.brigadier.ParseResults<CommandSource>parseprivate CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>pendingSuggestionsprivate booleanslashOptionalprivate booleansuggestingWhenEmptyprivate TextFieldWidgettextFieldprivate TextRenderertextRendererprivate intwidthprivate CommandSuggestor.SuggestionWindowwindowprivate booleanwindowActiveprivate intx -
Constructor Summary
Constructors Constructor Description CommandSuggestor(MinecraftClient client, Screen owner, TextFieldWidget textField, TextRenderer textRenderer, boolean slashRequired, boolean suggestingWhenEmpty, int inWindowIndexOffset, int maxSuggestionSize, boolean chatScreenSized, int color) -
Method Summary
Modifier and Type Method Description private static intgetLastPlayerNameStart(String input)private static StringgetSuggestionSuffix(String original, String suggestion)private static OrderedTexthighlight(com.mojang.brigadier.ParseResults<CommandSource> parse, String original, int firstCharacterIndex)booleankeyPressed(int keyCode, int scanCode, int modifiers)Stringmethod_23958()private List<com.mojang.brigadier.suggestion.Suggestion>method_30104(com.mojang.brigadier.suggestion.Suggestions suggestions)private static OrderedTextmethod_30505(com.mojang.brigadier.exceptions.CommandSyntaxException commandSyntaxException)booleanmouseClicked(double mouseX, double mouseY, int button)booleanmouseScrolled(double amount)private OrderedTextprovideRenderText(String original, int firstCharacterIndex)voidrefresh()voidrender(MatrixStack matrixStack, int int2, int int3)voidsetWindowActive(boolean windowActive)private voidshow()voidshowSuggestions(boolean narrateFirstSuggestion)private voidshowUsages(Formatting formatting)
-
Field Details
-
BACKSLASH_S_PATTERN
-
field_25885
-
field_25886
-
field_25887
-
client
-
owner
-
textField
-
textRenderer
-
slashOptional
private final boolean slashOptional -
suggestingWhenEmpty
private final boolean suggestingWhenEmpty -
inWindowIndexOffset
private final int inWindowIndexOffset -
maxSuggestionSize
private final int maxSuggestionSize -
chatScreenSized
private final boolean chatScreenSized -
color
private final int color -
messages
-
x
private int x -
width
private int width -
parse
-
pendingSuggestions
-
window
-
windowActive
private boolean windowActive -
completingSuggestions
private boolean completingSuggestions
-
-
Constructor Details
-
CommandSuggestor
public CommandSuggestor(MinecraftClient client, Screen owner, TextFieldWidget textField, TextRenderer textRenderer, boolean slashRequired, boolean suggestingWhenEmpty, int inWindowIndexOffset, int maxSuggestionSize, boolean chatScreenSized, int color)
-
-
Method Details
-
setWindowActive
public void setWindowActive(boolean windowActive) -
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) -
mouseScrolled
public boolean mouseScrolled(double amount) -
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) -
showSuggestions
public void showSuggestions(boolean narrateFirstSuggestion) -
method_30104
private List<com.mojang.brigadier.suggestion.Suggestion> method_30104(com.mojang.brigadier.suggestion.Suggestions suggestions) -
refresh
public void refresh() -
getLastPlayerNameStart
-
method_30505
private static OrderedText method_30505(com.mojang.brigadier.exceptions.CommandSyntaxException commandSyntaxException) -
show
private void show() -
showUsages
-
provideRenderText
-
getSuggestionSuffix
-
highlight
private static OrderedText highlight(com.mojang.brigadier.ParseResults<CommandSource> parse, String original, int firstCharacterIndex) -
render
-
method_23958
-