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,17 +63,19 @@ public class SWCommand extends AbstractSWCommand<CommandSender> {
@Override @Override
protected void createAndSafeCommand(String command, String[] aliases) { protected void createAndSafeCommand(String command, String[] aliases) {
this.command = new TabCompletableCommand(command, permission, aliases) { BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> {
@Override this.command = new TabCompletableCommand(command, permission, aliases) {
public void execute(CommandSender commandSender, String[] strings) { @Override
SWCommand.this.execute(commandSender, null, strings); public void execute(CommandSender commandSender, String[] strings) {
} SWCommand.this.execute(commandSender, null, strings);
}
@Override @Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] strings) { public Iterable<String> onTabComplete(CommandSender commandSender, String[] strings) {
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 {