fix: some emergency issue i don't know what is causing

This commit is contained in:
ChomeNS
2024-12-26 08:55:47 +07:00
parent 8217606437
commit 2df59435d0
3 changed files with 5 additions and 4 deletions

View File

@@ -1 +1 @@
1300
1301

View File

@@ -39,6 +39,7 @@ public class ListCommand extends Command {
final List<Component> playersComponent = new ArrayList<>();
for (PlayerEntry entry : list) {
if (entry == null) continue;
playersComponent.add(
Component.translatable(
"%s %s",

View File

@@ -91,7 +91,7 @@ public class PlayersPlugin extends Bot.Listener {
public final PlayerEntry getEntry (UUID uuid) {
for (PlayerEntry candidate : list) {
if (candidate.profile.getId().equals(uuid)) {
if (candidate != null && candidate.profile.getId().equals(uuid)) {
return candidate;
}
}
@@ -101,7 +101,7 @@ public class PlayersPlugin extends Bot.Listener {
public final PlayerEntry getEntry (String username) {
for (PlayerEntry candidate : list) {
if (getName(candidate).equals(username) || candidate.usernames.contains(username)) {
if (candidate != null && (getName(candidate).equals(username) || candidate.usernames.contains(username))) {
return candidate;
}
}
@@ -111,7 +111,7 @@ public class PlayersPlugin extends Bot.Listener {
public final PlayerEntry getEntry (Component displayName) {
for (PlayerEntry candidate : list) {
if (candidate.displayName != null && candidate.displayName.equals(displayName)) {
if (candidate != null && candidate.displayName != null && candidate.displayName.equals(displayName)) {
return candidate;
}
}