SteamWar/BungeeCore
Archiviert
13
2

Hotfix SWCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-06-16 22:11:24 +02:00
Ursprung 742bc92f53
Commit cc839859a8

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.command;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Message;
import de.steamwar.messages.ChatSender; import de.steamwar.messages.ChatSender;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -30,6 +31,7 @@ import net.md_5.bungee.api.plugin.TabExecutor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier; import java.util.function.Supplier;
import java.util.logging.Level; import java.util.logging.Level;
@ -61,6 +63,7 @@ public class SWCommand extends AbstractSWCommand<CommandSender> {
@Override @Override
protected void createAndSafeCommand(String command, String[] aliases) { protected void createAndSafeCommand(String command, String[] aliases) {
BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> {
this.command = new TabCompletableCommand(command, permission, aliases) { this.command = new TabCompletableCommand(command, permission, aliases) {
@Override @Override
public void execute(CommandSender commandSender, String[] strings) { public void execute(CommandSender commandSender, String[] strings) {
@ -72,6 +75,7 @@ public class SWCommand extends AbstractSWCommand<CommandSender> {
return SWCommand.this.tabComplete(commandSender, null, strings); return SWCommand.this.tabComplete(commandSender, null, strings);
} }
}; };
}, 100, TimeUnit.MILLISECONDS);
} }
private abstract static class TabCompletableCommand extends Command implements TabExecutor { private abstract static class TabCompletableCommand extends Command implements TabExecutor {