13
0
geforkt von Mirrors/Paper

Send empty commands if tab completion is disabled

Dieser Commit ist enthalten in:
Shane Freeder 2021-04-26 01:27:08 +01:00
Ursprung 3ab2001afb
Commit 6949e999eb

Datei anzeigen

@ -190,12 +190,17 @@
} }
} else { } else {
callback.accept(executioncontext); callback.accept(executioncontext);
@@ -377,22 +453,84 @@ @@ -377,22 +453,89 @@
} }
public void sendCommands(ServerPlayer player) { public void sendCommands(ServerPlayer player) {
- Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newHashMap(); - Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newHashMap();
+ if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot + // Paper start - Send empty commands if tab completion is disabled
+ if (org.spigotmc.SpigotConfig.tabComplete < 0) {
+ player.connection.send(new ClientboundCommandsPacket(new RootCommandNode<>()));
+ return;
+ }
+ // Paper end - Send empty commands if tab completion is disabled
+ // CraftBukkit start + // CraftBukkit start
+ // Register Vanilla commands into builtRoot as before + // Register Vanilla commands into builtRoot as before
+ // Paper start - Perf: Async command map building + // Paper start - Perf: Async command map building
@ -280,7 +285,7 @@
argumentbuilder.requires((icompletionprovider) -> { argumentbuilder.requires((icompletionprovider) -> {
return true; return true;
@@ -415,12 +553,12 @@ @@ -415,12 +558,12 @@
argumentbuilder.redirect((CommandNode) resultNodes.get(argumentbuilder.getRedirect())); argumentbuilder.redirect((CommandNode) resultNodes.get(argumentbuilder.getRedirect()));
} }
@ -295,7 +300,7 @@
} }
} }
} }
@@ -481,7 +619,7 @@ @@ -481,7 +624,7 @@
} }
private <T> HolderLookup.RegistryLookup.Delegate<T> createLookup(final HolderLookup.RegistryLookup<T> original) { private <T> HolderLookup.RegistryLookup.Delegate<T> createLookup(final HolderLookup.RegistryLookup<T> original) {