mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
fix: /tpaall and /tpall using wrong user list check, close #747
This commit is contained in:
2 files changed
+5
-2
No files matched your search
@@ -43,7 +43,7 @@ public class TpAllCommand extends InGameCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
|
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")
|
plugin.getLocales().getLocale("error_no_players_online")
|
||||||
.ifPresent(executor::sendMessage);
|
.ifPresent(executor::sendMessage);
|
||||||
return;
|
return;
|
||||||
@@ -52,6 +52,9 @@ public class TpAllCommand extends InGameCommand {
|
|||||||
final Position targetPosition = executor.getPosition();
|
final Position targetPosition = executor.getPosition();
|
||||||
try {
|
try {
|
||||||
for (OnlineUser user : plugin.getOnlineUsers()) {
|
for (OnlineUser user : plugin.getOnlineUsers()) {
|
||||||
|
if (!user.isValid()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Teleport.builder(plugin)
|
Teleport.builder(plugin)
|
||||||
.teleporter(user)
|
.teleporter(user)
|
||||||
.target(targetPosition)
|
.target(targetPosition)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class TpaAllCommand extends InGameCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
|
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")
|
plugin.getLocales().getLocale("error_no_players_online")
|
||||||
.ifPresent(executor::sendMessage);
|
.ifPresent(executor::sendMessage);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user