How kangarko/chatcontrol works
Project type and purpose
• This is a modular Minecraft server plugin suite (“ChatControl™”) for filtering and managing in-game chat across multiple server platforms.
• It supports Bukkit/Spigot, BungeeCord, and Velocity server types and provides cross-server synchronization, rule-based chat filtering, private messaging, join/quit/death messages, Discord integration, etc.
File structure
• Top-level POM pulls in five Maven modules:
• chatcontrol-core – shared API, models, enums, and synchronization logic
• chatcontrol-bukkit – Bukkit/Spigot implementation (commands, listeners, rule engine, database layer)
• chatcontrol-bungeecord – BungeeCord implementation (listener, hooks, plugin entry point)
• chatcontrol-velocity – Velocity implementation
• chatcontrol-proxy-core – cross-platform proxy logic (Redis pub/sub, proxy events, synchronized cache)
• Resources in each module include configuration (YML), language files, rule definitions, message templates.
• Build.xml and pom.xml in platform modules handle compilation and packaging.
• The database abstraction (model/db) under chatcontrol-bukkit indicates persistent storage (e.g., MySQL/SQLite via database.yml).
README for additional insights
• Mentions cross-server support via BungeeCord and Discord, and asynchronous offline player support.
• Instructs compilation against “Foundation v7” dependency.
a. Main components
• Minecraft Server Instances (Bukkit/Spigot)
• Proxy Server Instances (BungeeCord or Velocity)
• ChatControl Bukkit Plugin
• ChatControl BungeeCord/Velocity Plugin
• ChatControl Core Library (shared code)
• ChatControl Proxy Core (Redis integration)
• External Services & Stores:
– Redis (pub/sub for cross-server sync)
– Relational Database (persistent storage for mails, caches, settings)
– Discord API (for Discord support)
b. Relationships & interactions
1. Players connect to BungeeCord/Velocity Proxy
2. Proxy plugin intercepts chat/command events and publishes ProxyEvents via Redis
3. Bukkit plugin on each backend receives local PlayerChatEvents/CommandEvents
4. Bukkit plugin applies rule engine (RuleOperator, Checker) and may read/write to DB
5. If message must be broadcast cross-server, Bukkit plugin publishes ChatControlProxyMessage to Redis
6. Proxy-core module subscribes to Redis channels, relays messages to other server instances
7. Discord hook listens to events and forwards to Discord API if enabled
c. Architectural patterns & design principles
• Modular multi-platform design – core logic separated from platform adapters
• Event-driven architecture – custom events (ChannelPreChat, MuteEvent, etc.)
• Pub/Sub for synchronization – Redis acts as message bus for proxy <-> backend
• Rule engine – chain of Checker/Operator objects apply filtering rules loaded from YML
• Dependency Injection via Maven modules – core vs. platform modules
d. Key technologies, frameworks, libraries
• Java + Bukkit/Spigot API
• BungeeCord API or Velocity API
• Redis (Jedis or custom wrapper)
• Maven for build lifecycle
• YML for configuration, JSON for language files
• Foundation v7 plugin (external dependency)