mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 07:19:56 +03:00
40 lines
1.7 KiB
Diff
40 lines
1.7 KiB
Diff
--- ../src-base/minecraft/net/minecraft/util/TabCompleter.java
|
|
+++ ../src-work/minecraft/net/minecraft/util/TabCompleter.java
|
|
@@ -55,13 +55,14 @@
|
|
this.textField.deleteFromCursor(i - this.textField.getCursorPosition());
|
|
}
|
|
|
|
- this.textField.writeText(this.completions.get(this.completionIdx++));
|
|
+ this.textField.writeText(net.minecraft.util.text.TextFormatting.getTextWithoutFormattingCodes(this.completions.get(this.completionIdx++)));
|
|
}
|
|
|
|
private void requestCompletions(String prefix)
|
|
{
|
|
if (prefix.length() >= 1)
|
|
{
|
|
+ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(prefix);
|
|
Minecraft.getMinecraft().player.connection.sendPacket(new CPacketTabComplete(prefix, this.getTargetBlockPos(), this.hasTargetBlock));
|
|
this.requestedCompletions = true;
|
|
}
|
|
@@ -77,6 +78,12 @@
|
|
this.didComplete = false;
|
|
this.completions.clear();
|
|
|
|
+ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete;
|
|
+ if (complete != null)
|
|
+ {
|
|
+ newCompl = com.google.common.collect.ObjectArrays.concat(complete, newCompl, String.class);
|
|
+ }
|
|
+
|
|
for (String s : newCompl)
|
|
{
|
|
if (!s.isEmpty())
|
|
@@ -87,6 +94,7 @@
|
|
|
|
String s1 = this.textField.getText().substring(this.textField.getNthWordFromPosWS(-1, this.textField.getCursorPosition(), false));
|
|
String s2 = org.apache.commons.lang3.StringUtils.getCommonPrefix(newCompl);
|
|
+ s2 = net.minecraft.util.text.TextFormatting.getTextWithoutFormattingCodes(s2);
|
|
|
|
if (!s2.isEmpty() && !s1.equalsIgnoreCase(s2))
|
|
{
|