From c22857457b55da8f960ba6a1aa7cce980d7dd871 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 14 Dec 2023 15:01:32 +0100 Subject: [PATCH] Fix NPE of InviteCommand --- .../misslewars/commands/InviteCommand.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/de/steamwar/misslewars/commands/InviteCommand.java b/src/de/steamwar/misslewars/commands/InviteCommand.java index 620f151..5c5fc12 100644 --- a/src/de/steamwar/misslewars/commands/InviteCommand.java +++ b/src/de/steamwar/misslewars/commands/InviteCommand.java @@ -83,19 +83,12 @@ public class InviteCommand extends SWCommand { @ClassValidator(value = Player.class, local = true) public TypeValidator validator() { - return new TypeValidator() { - @Override - public boolean validate(CommandSender commandSender, Player player, MessageSender messageSender) { - if (Config.isChallenge()) { - messageSender.send("§cDieser Command ist deaktiviert."); - return false; - } - return true; + return (commandSender, player, messageSender) -> { + if (Config.isChallenge()) { + player.sendMessage("§cDieser Command ist deaktiviert."); + return false; } + return true; }; } - - private void message(MWTeam mwTeam, String s) { - mwTeam.getPlayers().forEach(player -> player.sendMessage(s)); - } }