geforkt von SteamWar/BungeeCore
Hotfix TypeMappers
Dieser Commit ist enthalten in:
Ursprung
5bfb2d5c71
Commit
0296716a4e
@ -1 +1 @@
|
|||||||
Subproject commit 1dea71993d897354d3f52a705f6e0e1e0c8ec580
|
Subproject commit a249d66dcf96bb9aef44b700438c81670ad81de7
|
@ -33,6 +33,7 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class TypeMappers {
|
public class TypeMappers {
|
||||||
@ -66,15 +67,19 @@ public class TypeMappers {
|
|||||||
return ArenaMode.getByChat(s);
|
return ArenaMode.getByChat(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean validate(CommandSender sender, ArenaMode value, MessageSender messageSender) {
|
|
||||||
if (value == null) return true;
|
|
||||||
return value.isHistoric() == historic;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<String> tabCompletes(CommandSender sender, String[] previousArguments, String s) {
|
public Collection<String> tabCompletes(CommandSender sender, String[] previousArguments, String s) {
|
||||||
return ArenaMode.getAllChatNames(historic);
|
if (!historic) {
|
||||||
|
List<String> toReturn = ArenaMode.getAllChatNames(false).stream()
|
||||||
|
.map(String::toLowerCase)
|
||||||
|
.filter(s1 -> s1.startsWith(s.toLowerCase()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (toReturn.isEmpty()) {
|
||||||
|
return ArenaMode.getAllChatNames(true);
|
||||||
|
}
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
return ArenaMode.getAllChatNames(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren