mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
Fixes to /tpall and /tpaall, update locales
This commit is contained in:
1 parent
5552db2de0
commit
85f8fe9a50
4 files changed
+19
-7
No files matched your search
@@ -15,12 +15,18 @@ public class TpAllCommand extends CommandBase {
|
||||
|
||||
@Override
|
||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
||||
if (args.length != 0) {
|
||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tpaall")
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
// Update cached players
|
||||
plugin.getCache().updateOnlinePlayerList(plugin, onlineUser);
|
||||
|
||||
// Determine players to teleport
|
||||
final List<String> players = plugin.getCache().players.stream()
|
||||
.filter(userName -> !userName.equals(onlineUser.username)).toList();
|
||||
.filter(userName -> !userName.equalsIgnoreCase(onlineUser.username)).toList();
|
||||
if (players.isEmpty()) {
|
||||
plugin.getLocales().getLocale("error_no_players_online").ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
|
||||
@@ -19,12 +19,18 @@ public class TpaAllCommand extends CommandBase {
|
||||
|
||||
@Override
|
||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
||||
if (args.length != 0) {
|
||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tpaall")
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
// Update cached players
|
||||
plugin.getCache().updateOnlinePlayerList(plugin, onlineUser);
|
||||
|
||||
// Determine players to send teleport requests to
|
||||
final List<String> players = plugin.getCache().players.stream()
|
||||
.filter(userName -> !userName.equals(onlineUser.username)).toList();
|
||||
.filter(userName -> !userName.equalsIgnoreCase(onlineUser.username)).toList();
|
||||
if (players.isEmpty()) {
|
||||
plugin.getLocales().getLocale("error_no_players_online").ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user