From 366d300450a659750b2fc93411586e5063352c4c Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Sun, 9 Sep 2018 17:51:25 -0400 Subject: [PATCH] Stop using transaction id in tab completions Fixes GH-1417, GH-1424 (probably). There are other issues in this area, including just how much a mess it is but we will get to those when we get to those. --- Spigot-Server-Patches/AsyncTabCompleteEvent.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Spigot-Server-Patches/AsyncTabCompleteEvent.patch b/Spigot-Server-Patches/AsyncTabCompleteEvent.patch index 90c485a2e2..3f2c4751d9 100644 --- a/Spigot-Server-Patches/AsyncTabCompleteEvent.patch +++ b/Spigot-Server-Patches/AsyncTabCompleteEvent.patch @@ -14,7 +14,7 @@ completion, such as offline players. Also adds isCommand and getLocation to the sync TabCompleteEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 23c07ca5c4..19e0181fc5 100644 +index 23c07ca5c..b04eae4bb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ import io.netty.util.concurrent.Future; @@ -73,7 +73,7 @@ index 23c07ca5c4..19e0181fc5 100644 + minecraftServer.postToMainThread(() -> sendSuggestions(packetplayintabcomplete, stringreader, otherSuggestions)); + return; + } else if (!completions.isEmpty()) { -+ com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packetplayintabcomplete.c(), packetplayintabcomplete.b()); ++ com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packetplayintabcomplete.c(), stringreader.getTotalLength()); + completions.forEach(suggestionsBuilder::suggest); + + player.playerConnection.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestionsBuilder.build())); @@ -90,7 +90,7 @@ index 23c07ca5c4..19e0181fc5 100644 + java.util.concurrent.CompletableFuture completionSuggestions = this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults); + completionSuggestions.thenAccept((Suggestions suggestions) -> { + if (otherSuggestions != null && !otherSuggestions.isEmpty()) { -+ com.mojang.brigadier.suggestion.SuggestionsBuilder builder = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packetplayintabcomplete.c(), packetplayintabcomplete.b()); ++ com.mojang.brigadier.suggestion.SuggestionsBuilder builder = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packetplayintabcomplete.c(), reader.getTotalLength()); + otherSuggestions.forEach(builder::suggest); + suggestions.getList().addAll(builder.build().getList()); + } @@ -101,7 +101,7 @@ index 23c07ca5c4..19e0181fc5 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c79e673fbf..015a8db94a 100644 +index c79e673fb..015a8db94 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -114,7 +114,7 @@ index c79e673fbf..015a8db94a 100644 return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions(); diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -index 1e3aae3b8f..95d13c146b 100644 +index 1e3aae3b8..95d13c146 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java @@ -0,0 +0,0 @@ public class ConsoleCommandCompleter implements Completer {