SPIGOT-5884: Tab completions lost on reloadData / minecraft:reload

This commit is contained in:
md_5 2020-06-30 10:51:26 +10:00
parent fb4e54ad7b
commit 92cbf65649
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
2 changed files with 9 additions and 3 deletions

View File

@ -643,7 +643,7 @@
}
public CrashReport b(CrashReport crashreport) {
@@ -1217,11 +1472,11 @@
@@ -1217,16 +1472,17 @@
public CompletableFuture<Void> a(Collection<String> collection) {
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
@ -657,7 +657,13 @@
}, this).thenCompose((immutablelist) -> {
return DataPackResources.a(immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this);
}).thenAcceptAsync((datapackresources) -> {
@@ -1592,6 +1847,22 @@
this.dataPackResources.close();
this.dataPackResources = datapackresources;
+ this.server.syncCommands(); // SPIGOT-5884: Lost on reload
this.resourcePackRepository.a(collection);
this.saveData.a(a(this.resourcePackRepository));
datapackresources.i();
@@ -1592,6 +1848,22 @@
}

View File

@ -429,7 +429,7 @@ public final class CraftServer implements Server {
}
}
private void syncCommands() {
public void syncCommands() {
// Clear existing commands
CommandDispatcher dispatcher = console.dataPackResources.commandDispatcher = new CommandDispatcher();