55import at .helpch .chatchat .api .rule .RuleManager ;
66import at .helpch .chatchat .api .user .ChatUser ;
77import com .google .common .collect .Sets ;
8+ import net .kyori .adventure .text .Component ;
9+ import org .jetbrains .annotations .NotNull ;
810
911import java .util .Collections ;
1012import java .util .Optional ;
1113import java .util .Set ;
1214import java .util .stream .Collectors ;
1315
14- import net .kyori .adventure .text .Component ;
15- import org .jetbrains .annotations .NotNull ;
16-
1716public class RuleManagerImpl implements RuleManager {
1817
1918 private final ChatChatPlugin plugin ;
@@ -23,8 +22,8 @@ public class RuleManagerImpl implements RuleManager {
2322
2423 public RuleManagerImpl (@ NotNull final ChatChatPlugin plugin ) {
2524 this .plugin = plugin ;
26- publicChatRules . add (new InvalidCharsRule (plugin ));
27- privateChatRules . add (new InvalidCharsRule (plugin ));
25+ addPublicChatRule (new InvalidCharsRule (plugin ));
26+ addPrivateChatRule (new InvalidCharsRule (plugin ));
2827 }
2928
3029 @ Override
@@ -69,7 +68,7 @@ public Optional<Component> isAllowedPrivateChat(
6968 @ NotNull final ChatUser recipient ,
7069 @ NotNull final String message
7170 ) {
72- final var unfulfilledRules = publicChatRules ()
71+ final var unfulfilledRules = privateChatRules ()
7372 .stream ()
7473 .filter (rule -> !rule .isAllowedPrivate (sender , recipient , message ))
7574 .collect (Collectors .toList ());
0 commit comments