refactor: make listeners an interface

(except the one in Bot, which extends MCProtocolLib's SessionAdaptor, not sure how exactly make them complement)
This commit is contained in:
ChomeNS
2025-03-23 14:18:55 +07:00
parent 60356a5eea
commit 0a8efe0189
30 changed files with 261 additions and 311 deletions

View File

@@ -367,8 +367,8 @@ public class ChatPlugin extends Bot.Listener {
public void addListener (Listener listener) { listeners.add(listener); }
public static class Listener {
public boolean playerMessageReceived (PlayerMessage message) { return true; }
public boolean systemMessageReceived (Component component, String string, String ansi) { return true; }
public interface Listener {
default boolean playerMessageReceived (PlayerMessage message) { return true; }
default boolean systemMessageReceived (Component component, String string, String ansi) { return true; }
}
}