fix: /tpaall and /tpall using wrong user list check, close #747

This commit is contained in:
William278 committed 2025-02-14 13:05:18 +00:00
1 parent a049e5af94
commit 22bfb921b6
2 files changed
+5 -2

No files matched your search

@@ -43,7 +43,7 @@ public class TpAllCommand extends InGameCommand {
@Override
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
if (plugin.getGlobalUserList().size() <= 1) {
if (plugin.getUserList().size() <= 1) {
plugin.getLocales().getLocale("error_no_players_online")
.ifPresent(executor::sendMessage);
return;
@@ -52,6 +52,9 @@ public class TpAllCommand extends InGameCommand {
final Position targetPosition = executor.getPosition();
try {
for (OnlineUser user : plugin.getOnlineUsers()) {
if (!user.isValid()) {
continue;
}
Teleport.builder(plugin)
.teleporter(user)
.target(targetPosition)
@@ -34,7 +34,7 @@ public class TpaAllCommand extends InGameCommand {
@Override
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
if (plugin.getGlobalUserList().size() <= 1) {
if (plugin.getUserList().size() <= 1) {
plugin.getLocales().getLocale("error_no_players_online")
.ifPresent(executor::sendMessage);
return;