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 class
CommandSuggestor.SuggestionWindow
-
Field Summary
Fields Modifier and Type Field Description private static Pattern
BACKSLASH_S_PATTERN
private boolean
chatScreenSized
private MinecraftClient
client
private int
color
private boolean
completingSuggestions
private static Style
field_25885
private static Style
field_25886
private static List<Style>
field_25887
private int
inWindowIndexOffset
private int
maxSuggestionSize
private List<OrderedText>
messages
private Screen
owner
private com.mojang.brigadier.ParseResults<CommandSource>
parse
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
pendingSuggestions
private boolean
slashOptional
private boolean
suggestingWhenEmpty
private TextFieldWidget
textField
private TextRenderer
textRenderer
private int
width
private CommandSuggestor.SuggestionWindow
window
private boolean
windowActive
private int
x
-
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 int
getLastPlayerNameStart(String input)
private static String
getSuggestionSuffix(String original, String suggestion)
private static OrderedText
highlight(com.mojang.brigadier.ParseResults<CommandSource> parse, String original, int firstCharacterIndex)
boolean
keyPressed(int keyCode, int scanCode, int modifiers)
String
method_23958()
private List<com.mojang.brigadier.suggestion.Suggestion>
method_30104(com.mojang.brigadier.suggestion.Suggestions suggestions)
private static OrderedText
method_30505(com.mojang.brigadier.exceptions.CommandSyntaxException commandSyntaxException)
boolean
mouseClicked(double mouseX, double mouseY, int button)
boolean
mouseScrolled(double amount)
private OrderedText
provideRenderText(String original, int firstCharacterIndex)
void
refresh()
void
render(MatrixStack matrixStack, int int2, int int3)
void
setWindowActive(boolean windowActive)
private void
show()
void
showSuggestions(boolean narrateFirstSuggestion)
private void
showUsages(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
-