- π Overview
- πΎ Features
- π Project Structure
- π Getting Started
- π° Contributing
- π License
The Mommons project is a modular Java-based software ecosystem designed to streamline development and deployment processes for distributed applications. Key features include consistent environment setup via Gradle and OpenJDK, efficient dependency management, and easy distribution of subprojects. It's ideal for developers working on complex server-side applications, particularly in environments requiring high scalability and maintainability.
Feature | Summary | |
---|---|---|
βοΈ | Architecture |
|
π© | Code Quality |
|
π | Documentation |
|
π | Integrations |
|
π§© | Modularity |
|
π§ͺ | Testing |
|
β‘οΈ | Performance |
|
π‘οΈ | Security |
|
π¦ | Dependencies |
|
π | Scalability |
|
βββ mommons/
βββ .github
β βββ workflows
βββ LICENSE
βββ README.md
βββ build.gradle
βββ gradle
β βββ wrapper
βββ gradlew
βββ gradlew.bat
βββ jitpack.yml
βββ mommons-bungee
β βββ build.gradle
β βββ settings.gradle
β βββ src
βββ mommons-entityframework
β βββ build.gradle
β βββ settings.gradle
β βββ src
β βββ test.bat
βββ mommons-shared
β βββ build.gradle
β βββ settings.gradle
β βββ src
βββ mommons-spigot
β βββ build.gradle
β βββ settings.gradle
β βββ src
βββ mommons-worker
β βββ build.gradle
β βββ settings.gradle
β βββ src
βββ settings.gradle
MOMMONS/
__root__
gradlew.bat - Gradlew.bat serves as the startup script for Gradle on Windows within the project, facilitating the initialization and configuration of the Gradle build environment
- It ensures the Java environment is correctly set, manages JVM options, and executes Gradle tasks, crucial for building and deploying the software efficiently.jitpack.yml - Specifies the Java development kit version and sets up the environment for the project by installing and configuring OpenJDK 17
- This configuration ensures that all developers and the continuous integration system use a consistent Java version, leading to more reliable builds and testing across different environments within the project's architecture.build.gradle - Configures the build environment for a Java-based project using Gradle, setting project metadata and specifying dependency management
- It establishes UTF-8 encoding for Java compilation, integrates Maven Central for repositories, and defines dependency on Lombok
- Additionally, it configures publishing settings for subprojects, facilitating their distribution via Maven with specified group ID, artifact ID, and versioning.settings.gradle - Defines the overarching project structure for 'Mommons', organizing it into several subprojects: mommons-worker, mommons-spigot, mommons-bungee, mommons-shared, and mommons-entityframework
- Each subproject is assigned a specific directory, facilitating modular development and maintenance across different components of the Mommons software ecosystem.
mommons-worker
build.gradle - Defines the build configuration for the 'mommons-worker' module within the 'cz.maku' project, specifying Java as the programming language and setting up Maven for publishing
- It manages dependencies critical for the module's functionality, including libraries for network communication, data processing, and annotation handling, ensuring compatibility and efficient project compilation.settings.gradle - Defines the root project name as "mommons-worker" and integrates the "mommons-shared" module by setting its directory path relative to the current project
- This configuration facilitates modular development by linking shared resources and functionalities, enhancing maintainability and scalability within the broader architecture of the codebase.src
main
java
cz
maku
mommons
worker
WorkerExecutable.java - WorkerExecutable in the Mommons project dynamically handles method and constructor invocations within worker classes, managing execution based on annotations that define task repetition, asynchronous behavior, and initialization sequences
- It ensures parameter compatibility and leverages logging for error handling, enhancing the robustness and flexibility of task execution in the system.Worker.java - Worker.java serves as the core component for managing and initializing services within the Mommons project
- It dynamically registers, initializes, and terminates services annotated with @Service, handling dependencies and lifecycle events
- The class also integrates logging and database connectivity, ensuring robust service management and error handling.WorkerServiceClass.java - WorkerServiceClass orchestrates the initialization, execution, and lifecycle management of worker services within the Mommons project
- It handles field injections, method invocations, and scheduled tasks, ensuring that services are dynamically loaded, executed, and periodically operated based on annotations
- This class also manages error logging and resource cleanup.WorkerField.java - WorkerField in the Mommons project encapsulates functionality for managing field values within worker objects dynamically
- It supports checking for specific annotations and safely updating field values, ensuring fields are accessible before modification
- This class is crucial for reflection-based operations where fields in worker objects need to be manipulated at runtime based on their annotations.annotation
Initialize.java - Defines an annotation named `Initialize` used within the `mommons-worker` module to designate specific methods for initialization tasks
- Applied at runtime, this annotation targets methods, signaling to the framework or application when and where initial setup procedures are necessary, enhancing modularity and clarity in method functionality across the system.Load.java - Defines a custom annotation `Load` used within the Mommons Worker module to mark fields and parameters that require dynamic content injection
- This annotation facilitates the automatic handling of dependencies in the application, streamlining the initialization and configuration processes across the system's architecture.PostInitialize.java - Defines a custom annotation, `PostInitialize`, used within the Mommons Worker module to designate methods that should be executed after the initialization phase of a component
- This annotation targets methods specifically, allowing for automated post-setup operations crucial for preparing components for use within the broader application architecture.Destroy.java - Defines a `Destroy` annotation used within the Mommons Worker module to specify methods that handle cleanup or teardown processes post-execution
- It includes an optional delay attribute, allowing developers to define a waiting period before the annotated method is executed, enhancing the flexibility and control over resource management in the application lifecycle.Service.java - Defines a custom Java annotation `Service` used to mark classes within the Mommons Worker module
- It categorizes services based on their functionalities such as command handling, event listening, scheduled tasks, conditional operations, and SQL interactions
- This annotation helps in managing service behavior and feature activation across the application's architecture.Async.java - Defines a custom Java annotation named `Async` used to mark methods within the `mommons-worker` module
- This annotation indicates that the marked methods should be executed asynchronously, supporting concurrent processing in the application
- It applies at runtime and targets method-level implementation, enhancing the module's ability to handle tasks efficiently without blocking the main execution flow.Repeat.java - Defines a custom Java annotation `Repeat` used to specify repetition behavior for methods within the Mommons Worker module
- It allows configuration of the execution period and initial delay, facilitating scheduled operations across the application
- This annotation plays a crucial role in automating tasks at defined intervals within the service architecture.AnotherThread.java - Defines a custom Java annotation, `AnotherThread`, used to mark methods within the `mommons-worker` module that should execute on a separate thread
- This annotation facilitates concurrent processing, enhancing the application's performance by allowing certain operations to run independently of the main execution flow.Condition.java - Defines a runtime annotation `Condition` applicable to types, which specifies a boolean condition
- This annotation is crucial for conditional logic in the application, enabling dynamic behavior based on the specified conditions
- It plays a significant role in controlling the execution flow within the `mommons-worker` module of the codebase.Plugin.java - Defines an annotation for marking classes as plugins within the Mommons Worker module
- The annotation includes metadata such as plugin name, description, main class, authors, version, API version, dependencies, and website
- This facilitates the management and integration of various plugins in the system, enhancing modularity and scalability.sql
Download.java - Defines an annotation used within the Mommons Worker module to specify SQL download operations
- The annotation targets methods, allowing developers to declare the SQL table, query, and scheduling parameters such as period and delay for automated data retrieval tasks within the application's architecture.subscriber
Subscriber.java - Defines the Subscriber interface within the Mommons project, crucial for managing subscription mechanisms
- It allows for the registration and unregistration of subscribers, retrieval of subscriber details, and the distribution of messages to specific subscribers
- This interface supports robust and dynamic subscriber management across the system, facilitating effective communication and data flow.local
LocalSubscriber.java - Defines an interface, LocalSubscriber, within the Mommons project, specifically for handling local message subscriptions
- It outlines a method for receiving messages, enabling components to react to data or events distributed locally within the application
- This interface is crucial for facilitating internal communication and event-driven interactions among different parts of the system.LocalSubscribersService.java - LocalSubscribersService manages a collection of local subscribers within the Mommons project
- It initializes, registers, and unregisters subscribers, maintaining a concurrent map for thread-safe operations
- The service also facilitates the targeted delivery of messages to registered subscribers, ensuring efficient and selective communication across the system.
.github
workflows
gradle.yml - Automates the continuous integration process for a Java project using GitHub Actions, triggered by code pushes
- It sets up Java, makes the Gradle wrapper executable, validates it, builds JAR files for different modules, and uploads these artifacts, ensuring each component is correctly compiled and stored for further use or deployment.code_quality.yml - Qodana, a code quality tool, is integrated into the project's workflow to analyze code during pull requests and pushes to the '2.0' branch
- Running on Ubuntu, it checks out the full commit history for accurate analysis and utilizes a secure token for authentication, ensuring high standards of code quality and security compliance across the development lifecycle.
mommons-spigot
build.gradle - Configures the build environment for the Mommons-Spigot module, specifying Java as the programming language and setting up Maven for dependency management
- It integrates various libraries and project modules essential for the development, including Spigot API and additional utilities like Guava and Gson, to enhance functionality related to Minecraft server operations.settings.gradle Defines the structure and interdependencies of the "mommons-spigot" project, setting it as the root and incorporating three subprojects: "mommons-worker," "mommons-shared," and "mommons-entityframework." Each subproject is linked to its respective directory, establishing a clear modular architecture that supports separate development and maintenance paths within the broader project ecosystem. src
main
resources
plugin.yml - MommonsLoader, defined in the plugin.yml, serves as the central loader for all plugins that depend on the Mommons framework
- It specifies MommonsPlugin as the main class, authored by itIsMaku, and outlines dependencies like HolographicDisplays
- This configuration ensures compatibility with API version 1.17 and enhances the modular architecture by managing inter-plugin dependencies and version control.java
cz
maku
mommons
worker
BukkitWorkerMethod.java - BukkitWorkerMethod class in the Mommons-Spigot project extends WorkerExecutable to handle Minecraft server tasks
- It determines whether methods are designated as commands or events by checking for specific annotations
- This functionality integrates with the server's command and event handling system, enhancing the modular architecture of the codebase by allowing dynamic method classification and execution.WorkerReceiver.java - WorkerReceiver in the Mommons project facilitates interaction with worker plugins by providing methods to retrieve specific worker instances and services
- It enables access to both plugin-specific and core workers, along with their associated services and configurations, streamlining the integration and management of plugin functionalities within the broader system architecture.WorkerBukkitServiceClass.java - WorkerBukkitServiceClass extends functionality within a Bukkit-based Java plugin, managing asynchronous and synchronous tasks, SQL data handling, and dynamic command and event registration
- It integrates with the broader system to facilitate scheduled operations, command execution, and event handling, enhancing modularity and scalability of the plugin's architecture.BukkitWorker.java - BukkitWorker serves as a crucial component within the Mommons project, managing the lifecycle and integration of services within a Bukkit (Minecraft server) environment
- It initializes, logs, and cleanly shuts down services, ensuring that each component is correctly set up and tied to the server's plugin system for optimal operation and resource management.plugin
WorkerPlugin.java - WorkerPlugin.java serves as an abstract base for plugins within the Mommons project, managing the lifecycle and integration of BukkitWorker instances
- It orchestrates the initialization, loading, and unloading of services, while also handling plugin enablement and disablement processes
- This class ensures seamless communication and service management across the plugin's architecture.annotation
BukkitCommand.java - BukkitCommand serves as a custom annotation within the Mommons Spigot project, enabling developers to define new commands in Minecraft servers
- It specifies command properties such as name, description, usage, aliases, and a fallback prefix, streamlining the integration and management of commands across the server's architecture.BukkitEvent.java - Defines an annotation used within the Mommons Spigot project to mark methods that handle Bukkit events
- By specifying the event type and priority, it streamlines the integration of event handling in Minecraft server plugins, enhancing modularity and maintainability of the codebase
- This annotation facilitates efficient event management and customization in plugin development.player
CloudPlayer.java - CloudPlayer in the Mommons project manages player data interactions, facilitating both local and cloud-based storage operations
- It supports player data retrieval, updates, and synchronization across different servers, leveraging asynchronous operations to enhance performance and scalability within the multiplayer server environment
- Additionally, it provides functionalities for player server connectivity.PlayerBukkitService.java - PlayerBukkitService in the Mommons-Spigot project manages player data interactions within a Minecraft server environment
- It handles player events such as pre-login, join, and quit by initializing, loading, and unloading player data respectively, ensuring data consistency and triggering custom events for further processing within the system's architecture.PlayerDataRepository.java - PlayerDataRepository manages player data interactions within the Mommons project, specifically handling the initialization, loading, and asynchronous database operations for player instances
- It ensures player data consistency across sessions by interfacing with the server's data services and a MySQL database, and also manages player events and errors related to data retrieval or storage.event
CloudPlayerUnloadEvent.java - CloudPlayerUnloadEvent in the mommons-spigot project triggers when a player is unloaded from the server
- It extends the PlayerEvent class, utilizing the Bukkit API to manage player events efficiently
- This class is crucial for handling player-specific actions upon disconnection, ensuring resources are appropriately freed and maintaining server performance.CloudPlayerLoadEvent.java - CloudPlayerLoadEvent in the mommons-spigot project triggers when a CloudPlayer instance is loaded, integrating with the Minecraft server events
- It extends PlayerEvent, allowing developers to handle custom behaviors linked to player data management
- Features include event cancellation and access to the associated CloudPlayer, enhancing control over player interactions within the game environment.CloudPlayerPreUnloadEvent.java - CloudPlayerPreUnloadEvent in the mommons-spigot project triggers before a CloudPlayer instance is unloaded, facilitating cleanup or data saving actions
- It extends PlayerEvent, integrating with Bukkit's event system to ensure smooth multiplayer interactions
- The event encapsulates both the standard Player and the specialized CloudPlayer, allowing for detailed context during event handling.token
NetworkTokenAction.java - NetworkTokenAction.java defines a class responsible for managing actions associated with network tokens in the Mommons Spigot project
- It encapsulates token-related data, including the token itself, associated actions, target server details, and expiration specifics, facilitating secure and timed interactions across different servers within the network.NetworkTokenWorker.java - NetworkTokenWorker manages the asynchronous retrieval and processing of network tokens from a database, specifically targeting unexecuted tokens linked to a server
- It checks token validity, logs errors for expired or unactionable tokens, and triggers registered actions if valid, updating execution status post-processing.NetworkTokenService.java - NetworkTokenService in the Mommons project manages the distribution and tracking of tokens across different servers
- It facilitates the addition of token-related actions, and supports asynchronous and synchronous token transmission with expiration settings, ensuring secure and efficient inter-server communication.Token.java - Token.java serves as a utility within the Mommons Spigot project, facilitating the creation of secure, randomized tokens
- Each token is associated with a specific action and carries a set of data
- This functionality is crucial for managing actions and ensuring secure data handling across the system's various components.plugin
MommonsPlugin.java - MommonsPlugin serves as the core component of the Mommons project, initializing and managing essential services such as database connections, data tables, and plugin dependencies
- It configures SQL tables for various data types, handles plugin loading and unloading processes, and integrates with external plugins to enhance functionality.bukkit
Inventories.java - Inventories.java provides utility functions for managing inventory slots within the Bukkit framework, specifically for identifying and counting empty slots in a given inventory
- It enhances inventory management capabilities, crucial for game modifications involving item storage and handling in the Minecraft server environment managed by the mommons-spigot project.Items.java - Items.java serves as a utility class within the Mommons Spigot project, facilitating the creation and manipulation of various item types in Minecraft
- It provides methods to generate custom items, books, and player heads with specific attributes, enhancing gameplay by allowing for personalized item features and interactions.Bukkits.java - Bukkits.java facilitates the conversion between Location objects and their string representations within the Mommons Spigot project
- It provides methods to serialize a Location to a string format and deserialize it back, using a defined separator
- This utility supports spatial data handling across different components of the Bukkit-based system.TextComponents.java - TextComponents in the mommons-spigot project facilitates the creation and dispatch of stylized chat messages within a Minecraft server environment
- It enables the embedding of interactive elements like hover and click events into messages, enhancing user interaction by allowing custom actions and tooltips directly in the chat interface.BossBars.java - BossBars.java in the Mommons-Spigot project facilitates the creation of customizable boss bars in Minecraft
- It leverages the Bukkit API to generate bars with specified text, color, style, and namespace, enhancing the visual feedback and interaction within the game environment
- This component is integral for dynamic in-game notifications and status displays.Colors.java - Colors.java provides utility functions for handling text colorization and formatting within the Bukkit-based Minecraft server environment
- It enables the translation of color codes, formatting clickable text elements, and the removal of color codes from strings, enhancing the visual presentation and interaction of text in the game.hologram
Lines.java - Defines an interface crucial for managing holographic display lines within the Mommons Spigot project
- Specifically, it facilitates the retrieval of hologram lines, which are essential for dynamic visual content in Minecraft servers
- This interface supports the modular architecture of the project by allowing various implementations that can handle different types of holographic content.TextHologramLine.java - TextHologramLine, part of the Mommons Spigot project, extends the functionality of holographic displays by managing text-based hologram lines
- It integrates with the HolographicDisplays API to facilitate the creation and manipulation of text within holograms, enhancing visual elements in the server environment
- This class specifically handles the storage and retrieval of text for holographic lines.Holograms.java - Holograms.java serves as a central management module for creating and handling holographic displays within the Mommons Spigot project
- It facilitates the creation of holograms with dynamic content, manages a registry of these holograms, and supports the integration of event listeners to respond to changes in hologram line data.Hologram.java - Hologram.java serves as a core component for managing and manipulating holographic displays within the MommonsPlugin environment
- It facilitates the creation, modification, and interaction of holograms, supporting dynamic content through animated text and item integration, and provides visibility control specific to player interactions in a Minecraft server setting.LinesChangeListener.java - LinesChangeListener.java defines an interface crucial for monitoring changes in hologram text within the Mommons Spigot project
- It enables other components of the system to react dynamically when the content of a hologram is updated, ensuring that all visual representations are current and accurate, thereby enhancing the interactive experience in the Minecraft server environment.AnimatedTextHologramLine.java - AnimatedTextHologramLine serves as an abstract base for creating animated text lines within holograms in the Mommons Spigot project
- It extends TextHologramLine, incorporating a refresh rate to manage animation timing, and requires implementation of a method to define behavior at each refresh interval, facilitating dynamic visual content in server environments.ItemHologramLine.java - ItemHologramLine.java defines a specialized hologram line for displaying item stacks within the Mommons Spigot project
- It extends the generic HologramLine class, integrating with the HolographicDisplays API to manage and render Minecraft item visuals as part of holographic displays, enhancing interactive elements in the game environment.HologramLine.java - HologramLine.java serves as an abstract base for creating various types of holographic display lines within the Mommons Spigot project
- It encapsulates the functionality necessary to interact with the HolographicDisplays API, specifically managing hologram lines
- This abstraction facilitates the extension and customization of hologram content, crucial for dynamic in-game displays.armorstand
ArmorStandContent.java - ArmorStandContent in the mommons-spigot project encapsulates the equipment an armor stand can display in a Minecraft server environment
- It defines storage for armor pieces and items, including headgear, chestplate, leggings, boots, and items held in both hands, facilitating customization and manipulation of armor stand appearances within the game.ArmorStand.java - ArmorStand.java defines an abstract class within the Mommons Spigot project, central to managing armor stand entities in a Minecraft server environment
- It integrates with holographic displays and provides a framework for custom player interactions with these entities, encapsulating properties like identity, location, and content specifics.ArmorStands.java - ArmorStands.java facilitates the creation and management of customizable armor stands in a Minecraft server environment
- It integrates holographic text features above the stands, allowing dynamic visual customization
- The class handles the positioning and equipping of armor stands with various items, enhancing interactive game elements.ArmorStandsBukkitService.java - ArmorStandsBukkitService in the Mommons-Spigot project serves as a listener for hologram line changes within the Bukkit framework
- It registers itself to monitor and react to modifications in hologram displays, ensuring dynamic updates and interactions in the game environment
- This component enhances the user experience by providing real-time hologram adjustments.scheduler
Schedulers.java - Schedulers.java serves as a utility class within the Mommons Bukkit plugin, providing methods to manage and schedule tasks on both synchronous and asynchronous bases
- It leverages the BukkitScheduler for timing operations, facilitating repeated and delayed task execution, crucial for handling game events and plugin functionality efficiently.menu
Item.java - Item.java serves as a utility class within the Mommons Spigot project, facilitating the creation and manipulation of item entities in a Minecraft server environment
- It provides methods to configure item properties such as material type, name, lore, enchantments, and visibility flags, streamlining the customization of items for gameplay enhancements.Menu.java - Menu.java serves as a foundational component in the Mommons Spigot project, managing interactive player menus within a Minecraft server environment
- It facilitates the creation, display, and interaction handling of custom inventory interfaces, allowing for dynamic element management and event-driven actions specific to player interactions.MenuElement.java - MenuElement in the Mommons Spigot project serves as a fundamental component for creating interactive menu items within the game's user interface
- It encapsulates both the visual representation of an item and its associated behavior, which is triggered by player interactions, specifically inventory click events
- This class streamlines the development of customizable, interactive menus for players.MenuManager.java - MenuManager in the mommons-spigot project serves as a central hub for managing player-specific menu interactions within a Minecraft server environment
- It tracks and handles menu states for players using a UUID-keyed map, facilitating menu operations such as opening, clicking, and closing through event-driven methods, thereby enhancing the interactive experience in the game's UI.MenuContainer.java - MenuContainer.java serves as a management layer for user interface elements within a Bukkit-based Minecraft server plugin
- It facilitates the dynamic organization and manipulation of menu elements and sub-containers, ensuring elements are correctly positioned within predefined slots and handling exceptions when elements exceed container bounds.exception
MenuContainerSizeException.java - Defines a custom exception, MenuContainerSizeException, used within the Mommons Spigot project to handle errors specifically related to incorrect menu container sizes in the Bukkit menu system
- This exception aids in enforcing correct menu dimensions, ensuring that the user interface behaves as expected across the application.dependency
Dependencies.java - Dependencies.java manages the loading and initialization of plugin dependencies within the Mommons Spigot framework
- It dynamically resolves dependencies, handles their lifecycle, and ensures isolation where necessary, enhancing modularity and error handling in plugin development
- The class supports conditional loading and isolated execution environments for robust plugin functionality.Dependency.java - Dependency.java serves as an abstract base for creating and managing dependencies within the Mommons Spigot plugin architecture
- It encapsulates the lifecycle of dependencies, including their construction, initialization, and potential reconstruction, ensuring that each dependency is properly integrated and functional within the broader plugin ecosystem.DependencyClassProvider.java - DependencyClassProvider serves as an interface within the Mommons Spigot project, defining methods to manage and verify the loading of dependencies for plugins
- It ensures that classes representing dependencies are correctly identified and assesses their compatibility with the core application, facilitating smooth integration and functionality enhancement in the broader server architecture.isolation
IsolatedEnvironment.java - IsolatedEnvironment.java defines an interface crucial for creating isolated execution environments within the Mommons Spigot project
- It enables the safe execution of operations with dependencies that should not interact with the main application context, thereby enhancing modularity and reducing conflict among components across the software architecture.IsolatedEnvironmentProvider.java - IsolatedEnvironmentProvider serves as an abstract base within the Mommons Spigot project, facilitating the creation of isolated runtime environments for plugins
- It determines the specific environment class for isolation and checks if a plugin can run based on its dependencies, ensuring compatibility and stability across different plugin executions.server
ServerBukkitService.java - ServerBukkitService in the Mommons-Spigot project manages player interactions with the server, handling events such as pre-login checks, player joins, and quits to ensure database connectivity and accurate player count
- It also processes specific commands, allowing privileged users to modify player permissions dynamically.ServerData.java - ServerData.java serves as a utility class within the Mommons Spigot project, providing methods to access and filter server data
- It enables retrieval of server details by ID, type, or custom conditions, leveraging immutable data structures to ensure thread-safe operations and maintain data integrity across the application.LocalServerInfo.java - LocalServerInfo serves as a utility class within the Mommons Spigot project, primarily responsible for managing and retrieving the local server's IP address and port information
- It facilitates asynchronous acquisition of server details and integrates with the WorkerReceiver to fetch server configurations dynamically, enhancing the system's adaptability and responsiveness in network-related operations.Server.java - Server.java defines a Server class that manages server-specific data, integrating both local and cloud storage mechanisms
- It supports operations like retrieving and updating server details, player counts, and server types, leveraging asynchronous communication for data handling
- The class also ensures data persistence through MySQL and local storage, facilitating efficient data synchronization and retrieval.ServerDataService.java - ServerDataService in the Mommons project initializes and manages server data, interfacing with a MySQL database to retrieve and store server-specific configurations and information
- It ensures data consistency by updating or inserting new server details during initialization and removing them upon destruction.ServerDataRepository.java - ServerDataRepository manages the synchronization and updating of server data within the Mommons project
- It periodically fetches server details from a database, updates a concurrent map with fresh server information, and ensures outdated entries are removed
- This component enhances data consistency and availability across the system by leveraging asynchronous operations.cloud
DirectCloud.java - DirectCloud in the Mommons-Spigot project facilitates interaction with cloud storage specific to servers and players, providing methods to insert, update, and retrieve data
- It utilizes MySQL for database operations and is marked for future removal, indicating a shift towards newer methodologies or technologies within the project's architecture.DirectCloudStorage.java - DirectCloudStorage serves as an enumeration within the Mommons project, defining specific cloud storage categories for servers and players
- It maps these categories to corresponding SQL tables, facilitating data management and retrieval
- Marked for deprecation, this component highlights planned updates and refactoring in the project's approach to handling cloud-based data storage.CloudData.java - CloudData in the mommons-spigot project serves as an interface for interacting with cloud-based data storage
- It allows retrieval and asynchronous updating of values associated with specific keys
- Marked as deprecated and scheduled for removal, it suggests a shift towards newer methods or architectures within the project for handling cloud data operations.CachedCloud.java - CachedCloud serves as a caching layer within the Mommons project, managing asynchronous data interactions with a MySQL database
- It updates and retrieves key-value pairs, ensuring data consistency and reducing database query load by maintaining a local cache that is periodically synchronized with the database.
mommons-bungee
build.gradle - Configures the build environment for the 'mommons-bungee' module within the larger project, specifying Java as the programming language and setting up Maven for dependencies management
- It integrates essential libraries and projects, ensuring compatibility and enhancing functionality with external Maven repositories for comprehensive software development and distribution.settings.gradle - Defines the structure and interdependencies of the "mommons-bungee" project within the larger codebase
- It establishes "mommons-bungee" as the root project and integrates two subprojects, "mommons-worker" and "mommons-shared," by setting their respective directories
- This configuration facilitates modular development and shared resource management across different components of the system.src
main
resources
config.yml - Config.yml located in mommons-bungee/src/main/resources serves as the configuration backbone for database connectivity within the project
- It specifies the database address, port, credentials, and connection settings, ensuring secure and reliable database interactions essential for the application's data management and operational stability across its architecture.plugin.yml - MommonsProxy, defined in the plugin.yml, serves as a central loader for all dependent plugins within the Mommons architecture
- Positioned in the mommons-bungee/src/main/resources directory, it specifies MommonsPluginBungee as the main class, authored by itIsMaku
- This configuration file outlines the plugin's purpose, authorship, and version, crucial for managing dependencies and ensuring compatibility across the system.java
cz
maku
mommons
worker
BungeeWorkerReceiver.java - BungeeWorkerReceiver in the Mommons-Bungee project serves as a utility class for retrieving service instances managed by a Worker
- It facilitates access to various services by returning the specific service object associated with a given class, ensuring that components within the architecture can efficiently interact and utilize shared functionalities.BungeeWorker.java - BungeeWorker, a subclass within the Mommons project, manages the lifecycle and integration of services within a BungeeCord plugin environment
- It initializes and terminates services dynamically, ensuring that each service is properly configured and logged, enhancing the plugin's operational efficiency and reliability in server management tasks.BungeeWorkerMethod.java - BungeeWorkerMethod in the Mommons-Bungee project extends WorkerExecutable to handle BungeeCord-specific functionalities
- It determines whether methods are designated as commands or events by checking for the presence of BungeeCommand and BungeeEvent annotations, facilitating the dynamic execution of BungeeCord operations within the application's architecture.WorkerBungeeServiceClass.java - WorkerBungeeServiceClass extends functionality within a BungeeCord plugin environment, managing asynchronous tasks and event handling
- It schedules SQL data retrieval and repetitive tasks, integrates custom command execution, and processes event-driven actions
- This class effectively bridges game server operations with backend data processes, enhancing plugin responsiveness and functionality.plugin
BungeeWorkerPlugin.java - BungeeWorkerPlugin serves as an abstract base for plugins within the Mommons project, managing the lifecycle of BungeeWorker instances
- It orchestrates initialization, service registration, and cleanup processes for plugins, ensuring they properly integrate with the overarching system's architecture
- This setup facilitates efficient resource management and service handling during the plugin's active phases.annotation
BungeeCommand.java - BungeeCommand.java defines an annotation used within the Mommons Bungee project to declare and configure new commands for a BungeeCord server environment
- It specifies command properties such as name, description, permissions, usage instructions, aliases, and a fallback prefix, streamlining the integration and management of commands across the system.BungeeEvent.java - Defines an annotation, BungeeEvent, used within the Mommons Bungee project to mark methods that handle specific events in a BungeeCord environment
- By specifying the event class, it streamlines the integration of event-driven behaviors across the application, enhancing modularity and clarity in event management
- This annotation is crucial for developers to efficiently bind actions to various server events.bserver
bServerDataRepository.java - bServerDataRepository manages a dynamic repository of server data within the Mommons project
- It periodically updates and synchronizes server information from a MySQL database, ensuring that the server list is current and accurate
- This component leverages asynchronous operations to maintain performance while handling data-intensive tasks.bServer.java - bServer, part of the Mommons project, manages server data interactions with a MySQL database, specifically handling server identification and operational data like online players and server type
- It provides asynchronous retrieval of server information, including IP and port, leveraging the project's execution service for efficient data processing.bLocalServerInfo.java - Defines a class `bLocalServerInfo` within the `mommons-bungee` project, responsible for storing and providing access to local server configuration details, specifically IP address and port number
- This class supports the broader architecture by encapsulating server connectivity properties, essential for network operations and inter-server communication within the system.plugin
MommonsPluginBungee.java - MommonsPluginBungee serves as the core integration point for the BungeeCord platform within the Mommons project, managing configuration and database connectivity
- It initializes essential services, handles configuration file creation and loading, establishes MySQL connections, and ensures clean disconnection on unload, thereby setting up the infrastructure for further plugin operations and data handling.bungee
Schedulers.java - Schedulers.java facilitates asynchronous task management within the Mommons Bungee plugin architecture
- It provides methods to execute, delay, or periodically repeat tasks asynchronously using the BungeeCord proxy server's scheduling capabilities
- This centralizes task scheduling, enhancing maintainability and scalability by leveraging the native Bungee API.
mommons-shared
build.gradle - Configures the build environment for the 'mommons-shared' module, specifying Java as the programming language and setting up Maven for publishing
- It defines the project's metadata, source encoding, repository sources, and manages dependencies essential for the module's functionality, including libraries for data handling, network communication, and database connectivity.settings.gradle - Sets the name of the root project in the "mommons-shared" module, establishing its identity within the broader project architecture
- This configuration is crucial for project recognition and management across tools and scripts that automate or facilitate project operations, ensuring consistent referencing and interaction within the multi-module setup.src
main
java
cz
maku
mommons
Response.java - Response.java defines a structure for handling operation outcomes within the Mommons project, distinguishing between successful executions and exceptions
- It provides methods to validate responses, identify exceptions, and convert runnable tasks into standardized response formats, enhancing error handling and response consistency across the application.Mommons.java - Mommons.java establishes core utilities for the Mommons project, configuring a JSON parser with Gson for flexible data handling, an ExecutorService for managing asynchronous tasks, and an OkHttpClient for HTTP communications
- These foundational components support various functionalities across the entire codebase, enhancing data processing and network operations efficiency.ExceptionResponse.java - ExceptionResponse, part of the Mommons project, extends the Response class to encapsulate exception handling by including an exception object alongside standard response attributes
- It enhances error reporting by allowing the transmission of exception details, potentially improving debugging and logging within the system's architecture.discord
Webhook.java - Webhook.java in the Mommons project facilitates communication with Discord services by allowing the creation and sending of customized messages via webhooks
- It supports text, embedded rich content, and user customization options such as username and avatar settings
- This component is crucial for integrating interactive and dynamic content into Discord channels.storage
local
LocalData.java - LocalData.java defines an interface for managing local storage operations within the Mommons project
- It facilitates the retrieval and updating of values stored locally, ensuring data integrity through exception handling
- The interface supports basic CRUD operations, enhancing the project's ability to handle data efficiently and securely across its various components.database
Database.java - Defines the essential operations for database interaction within the Mommons project, serving as a foundational interface for managing database connections
- It specifies methods to connect, disconnect, check connection status, and retrieve the database connection object, ensuring uniform database operations across different implementations in the codebase.SQLRow.java - SQLRow serves as a utility class within the Mommons project, facilitating the manipulation and retrieval of data from SQL database rows
- It allows for storing and accessing various data types, including strings, integers, and doubles, and supports JSON object conversion using the integrated GSON library for complex data handling.SQLTable.java - SQLTable in the Mommons project facilitates the creation and management of SQL tables within a MySQL database environment
- It allows dynamic definition of table structures, including column names and data types, and supports table creation with SQL commands tailored to the defined schema
- This class is integral for database operations across the application.type
MySQL.java - MySQL.java serves as the primary interface for managing MySQL database interactions within the Mommons project
- It facilitates database connectivity, executes synchronous and asynchronous queries, and checks for the existence of specific data rows
- This class ensures robust database operations by handling connection stability and data retrieval efficiently.AutoIncrement.java - Defines a class within the Mommons project that represents the auto-increment functionality typically used in database schemas
- Situated in the storage and database management layer of the architecture, it plays a crucial role in handling automatic index incrementation for database entries, ensuring unique identifiers for records across the system.Json.java - Defines a Json data type within the Mommons project, specifically under the storage and database management subsystem
- It serves as a foundational component for handling JSON data interactions across various modules of the application, ensuring consistent data formatting and manipulation
- This class is integral to the project's ability to manage and store structured data efficiently.IdString.java - Defines a custom data type, `IdString`, within the `mommons-shared` module, specifically under the database type package
- It serves as a specialized identifier across the application's database interactions, enhancing data handling and consistency
- This class is integral to the architecture, ensuring uniform ID management throughout various components of the system.JDBC.java - JDBC.java serves as a connector for Java applications to interact with databases via JDBC, managing database connections, authentication, and state
- It supports operations such as connecting to, disconnecting from, and checking the status of database connections, thereby facilitating robust database interactions within the broader Mommons project architecture.TimeStamp.java - TimeStamp.java defines a custom data type within the Mommons project, specifically tailored for handling timestamp operations in the database layer
- Situated in the storage and database management segment of the codebase, it plays a crucial role in ensuring accurate and efficient date and time processing across various components that require time-based data handling.IdAutoIncrement.java - Defines a class within the Mommons project that likely serves as a utility for handling database operations related to automatically incrementing identifiers
- Positioned within the storage and database management layer of the architecture, it plays a crucial role in data integrity and auto-generation of primary keys for database entities.logger
LoggerHandler.java - LoggerHandler, located within the mommons-shared module, enhances logging capabilities by dynamically assigning log records with thread and class-specific details
- It formats log entries with color-coded output for improved readability and manages the flushing and closing of system outputs, ensuring streamlined log handling across the application.cache
ExpiringMap.java - ExpiringMap in the `mommons-shared` module provides a self-managing cache mechanism where entries expire after a specified duration
- It supports operations to add, renew, delete, and retrieve entries based on key-value pairs, automatically purging outdated items based on the predefined time unit and duration
- This utility enhances data handling efficiency by ensuring temporal relevance.ExpirableValue.java - ExpirableValue.java defines a generic class for managing values that expire after a specified duration, using Java's time units
- It allows for setting, renewing, and automatically clearing values based on time elapsed, ensuring data freshness within the application's caching system
- This functionality is crucial for maintaining optimal memory usage and data integrity across the software's caching mechanisms.ExpiringList.java - ExpiringList in the mommons-shared module manages a collection of elements paired with timestamps, automatically removing items based on a predefined expiration time
- It supports operations such as adding, renewing, and deleting elements, ensuring the list only contains valid, non-expired items
- This functionality is crucial for handling time-sensitive data across the application.utils
Cooldown.java - Cooldown.java serves as a utility within the Mommons project, managing time-based restrictions across various functionalities
- It establishes a cooldown period using specified time units and checks if this period has expired
- This mechanism is crucial for controlling the frequency of operations, enhancing performance and preventing abuse in processes that require regulated execution intervals.Reflections.java - Reflections.java, located within the `mommons-shared/src/main/java/cz/maku/mommons/utils` directory, provides utility functions for dynamically identifying and selecting constructors in Java classes based on given parameters
- This capability is essential for facilitating flexible instantiation mechanisms across the codebase, enhancing modularity and adaptability in component integration and testing scenarios.Quadruple.java - Quadruple.java defines a utility class within the Mommons project, facilitating the grouping of four related values of potentially different types
- Positioned in the utilities package, it enhances data handling capabilities across the system by allowing complex data structures to be managed more effectively, supporting diverse functionalities throughout the application's modules.Files.java - Files.java in the mommons-shared utility package provides essential file management functions within the broader codebase
- It facilitates the downloading of files from specified URLs and supports recursive deletion of directories and their contents, ensuring efficient file handling and resource management across various components of the project.Collections.java - Collections.java in the mommons-shared module provides utility functions for manipulating collections in Java
- It includes methods to retrieve a random element from any collection and to sort a map by its values, ensuring enhanced functionality for data handling across the application
- These utilities support various operations requiring element selection and order consistency in data structures.ConsoleColors.java - Provides a comprehensive set of constants for colorizing console output, enhancing readability and debugging effectiveness across various components of the application
- It includes definitions for standard, bold, underlined, background, and bright color variations, facilitating diverse visual cues in terminal environments integral to the project's logging and interface functionalities.Nets.java - Nets.java in the Mommons project provides utility functions for network-related operations
- It includes methods to check port availability, retrieve an available port from a list, and fetch the public IP address of the current machine using an external API
- These utilities support network configuration and management tasks within the application.Rests.java - Rests.java serves as a utility class within the Mommons project, facilitating HTTP operations such as GET and POST requests
- It leverages the project's centralized HTTP client and JSON parser to interact with web services, handling responses by converting them into specified Java object types, optionally handling custom headers.Pair.java - Defines a generic Pair class within the Mommons shared utility library, facilitating the storage and management of two related objects
- This class is essential for operations requiring paired values across various modules of the project, enhancing code reusability and maintainability by providing a standardized way to handle dual elements.Triple.java - Triple.java defines a generic utility class within the Mommons project, facilitating the grouping of three related objects of potentially different types
- Positioned in the utilities package, it serves as a foundational component that enhances modularity and data handling capabilities across various modules of the system, supporting complex data structures and operations.Timers.java - Timers.java in the Mommons shared utility library facilitates the scheduling of recurring tasks
- It provides a method to repeatedly execute user-defined tasks with specified initial delays and subsequent intervals
- This utility supports various components across the project by allowing efficient task management and timing operations, enhancing modularity and reusability within the codebase.Texts.java - Provides utility functions for text manipulation and formatting within the Mommons project, including creating structured text blocks, checking string content, formatting class names, generating progress bars, and modifying string cases
- These utilities support various features across the application, enhancing text handling and user interface components.
mommons-entityframework
test.bat - Executes the compiled Java archive of the Mommons Entity Framework, version 2.0.3, facilitating testing within the project's architecture
- By running the all-inclusive jar file, it ensures that all components of the framework are functioning as expected before deployment, enhancing reliability and stability across the system
- The inclusion of a pause command aids in reviewing output during manual testing.build.gradle - Configures the build environment for the 'mommons-entityframework' module, specifying dependencies critical for its operation, including shared libraries and worker modules
- It sets up the Java plugin, shadow plugin for creating fat JARs, and Maven publishing
- The build script also defines the main class and manages both internal and external library dependencies essential for the module's functionality.settings.gradle - Defines the structure and relationships for the "mommons-entityframework" project, linking it with the "mommons-shared" and "mommons-worker" modules
- It sets up a multi-module Gradle project, specifying the directories for these connected modules, thereby organizing the overall build configuration and facilitating modular development across the project.src
main
java
cz
maku
mommons
ef
Tables.java - Tables.java facilitates the dynamic creation of SQL tables based on annotated Java class definitions
- It interprets Java classes as database table schemas, automatically generating SQL statements to create tables with appropriate data types, default values, and primary keys, ensuring compatibility and ease of database schema management within the Mommons EntityFramework module.RepositoryCachingException.java - RepositoryCachingException, defined within the Mommons EntityFramework module, serves as a specialized exception class
- It is utilized across the application to handle and signal specific errors related to caching operations within repositories, enhancing error management and debugging processes in the data access layer of the architecture.Entities.java - Entities.java serves as a utility class within the Mommons EntityFramework, facilitating the dynamic handling of entity classes
- It provides methods to determine entity metadata, manage field naming conventions based on annotations, and identify primary key fields
- This functionality is crucial for the framework's ability to interact with and manipulate database entities effectively.Repositories.java - Repositories.java facilitates the creation of repository instances for managing database operations on entities
- It dynamically selects an appropriate repository class based on entity annotations or defaults to a generic implementation
- This component supports custom ID fields and naming policies, enhancing flexibility in database interaction within the Mommons EntityFramework module.RepositoryCache.java - RepositoryCache in the `mommons-entityframework` module manages caching for data objects, enhancing data retrieval efficiency by storing frequently accessed items
- It interfaces with a repository to cache and retrieve entities using unique identifiers, and handles exceptions if caching operations fail, ensuring robust data management within the application's architecture.ColumnValidator.java - ColumnValidator in the Mommons EntityFramework module ensures data integrity by validating Java class fields against predefined default types and custom converters
- It leverages annotations to apply specific type conversions, facilitating seamless data handling and storage operations within the application's architecture
- This component is crucial for maintaining type safety and consistency across the system.statement
MySQLStatementImpl.java - MySQLStatementImpl in the mommons-entityframework module handles the execution of SQL statements specifically tailored for MySQL databases
- It supports various statement types, including SELECT and table creation, managing SQL arguments dynamically
- The class facilitates querying and updating the database, returning results as a list of records, encapsulating database interaction logic efficiently.CompletedStatement.java - CompletedStatement in the Mommons EntityFramework module encapsulates the result of executing a database statement, pairing the original statement with its resultant records
- It provides access to these records, specifically allowing retrieval of the first record, which facilitates handling of query outcomes within the broader architecture of the database interaction layer.StatementType.java - Defines the types of SQL statements supported within the Mommons EntityFramework module, specifically categorizing operations as SELECT, DELETE, CREATE, and UPDATE
- This enumeration facilitates the handling and execution of database operations, ensuring that components within the framework can uniformly interpret and process these fundamental SQL commands.Statement.java - Statement.java defines an interface for managing SQL statements within the Mommons EntityFramework module
- It facilitates the creation, execution, and querying of database statements, allowing dynamic argument setting and retrieval of execution results
- This interface is crucial for abstracting database interactions, ensuring flexible and efficient data management across the application.record
Record.java - Record.java defines an interface crucial for data retrieval within the Mommons EntityFramework
- It standardizes methods to fetch and manipulate data from database records, supporting various data types and JSON conversion
- This interface ensures consistent data handling across different parts of the application, facilitating easier data integration and manipulation.DefaultRecordImpl.java - DefaultRecordImpl serves as a fundamental component within the Mommons EntityFramework, managing data record operations
- It facilitates the storage and retrieval of various data types, including strings, integers, and doubles, from a centralized column map
- Additionally, it supports converting JSON-formatted string data into Java objects, enhancing data handling and object-relational mapping capabilities.query
QueryBuilder.java - QueryBuilder.java defines an interface essential for constructing SQL queries within the Mommons EntityFramework
- It facilitates the creation of conditional statements through a default method and mandates the implementation of a method to compile the query into a string format, ensuring integration and functionality across the framework's database operations.SelectQuery.java - SelectQuery.java is part of the Mommons EntityFramework, responsible for constructing SQL SELECT queries
- It enables dynamic specification of columns and the source table, incorporating conditions through a ConditionBuilder
- This class streamlines the creation of customized query strings essential for data retrieval operations within the application's database interaction layer.ConditionBuilder.java - ConditionBuilder in the mommons-entityframework module facilitates the dynamic construction of SQL query conditions
- It supports methods to specify equality, containment, and logical connectors (AND, OR), assembling them into a coherent SQL WHERE clause
- This component is crucial for generating precise database queries based on varying runtime criteria.converter
TypeConverter.java - TypeConverter.java defines an interface crucial for mapping between entity fields and database columns within the Mommons EntityFramework
- It facilitates the conversion of data types when persisting to or fetching from a database, ensuring type safety and data integrity across the application's data access layer
- This interface is foundational for custom data handling strategies in the project.entity
EntityClass.java - EntityClass.java serves as a foundational component in the Mommons EntityFramework, managing the mapping of Java class fields to database columns
- It dynamically resolves field names based on annotations and naming policies, ensuring compliance with SQL standards and custom attributes
- This class enhances data integrity and simplifies database interactions within the application architecture.NamePolicy.java - Defines an enumeration, NamePolicy, within the Mommons EntityFramework module, which specifies naming conventions for entities
- It offers two options: SQL, which likely adapts entity names to SQL database naming conventions, and JAVA, which aligns names with Java programming standards
- This enumeration aids in maintaining consistency in entity representation across different system components.repository
Repository.java - Repository.java defines an interface for data access operations within the Mommons EntityFramework, supporting CRUD operations and queries on database entities
- It facilitates interaction with MySQL databases, manages caching, and ensures type safety through generic parameters for entity and ID types, enhancing modularity and reusability across the architecture.DefaultRepository.java - DefaultRepository serves as a central component for managing database operations related to entity persistence in the Mommons EntityFramework
- It provides mechanisms for CRUD operations, leveraging SQL statements to interact with a database, and includes functionalities for querying, inserting, updating, and deleting records based on entity annotations and field validations.annotation
Id.java - Defines a custom annotation `Id` used to mark fields within classes as unique identifiers in the context of the Mommons EntityFramework
- This annotation facilitates the automatic handling of entity identification within the framework, streamlining database operations such as retrieval and storage by clearly specifying the primary key fields in entity classes.AutoIncrement.java - Defines an annotation, AutoIncrement, used to mark specific fields in entity classes within the Mommons EntityFramework
- This annotation indicates that the marked field should automatically increment, typically used for primary key fields in database tables, facilitating unique record identification and management in the application's data layer.Ignored.java - Defines an annotation within the Mommons EntityFramework module, used to mark specific fields in Java classes that should be ignored by the framework's processing mechanisms
- This annotation helps in customizing the behavior of data handling, ensuring that certain fields are excluded from database serialization or other automated operations.AttributeName.java - Defines a Java annotation, AttributeName, used to specify custom names for fields within entity classes in the Mommons EntityFramework module
- It targets field elements and retains annotation data at runtime, allowing for dynamic retrieval and usage of these custom names during database operations and entity management.Entity.java - Defines an annotation for marking classes as entities within the Mommons EntityFramework
- It allows customization of entity naming strategies and the association with specific repository classes for database operations, enhancing the framework's adaptability and integration with various data storage solutions.AttributeConvert.java - Defines a custom annotation, `AttributeConvert`, used within the Mommons EntityFramework to specify conversion logic for entity attributes
- It targets field elements, allowing developers to assign specific converters that handle data transformation between database representations and entity attributes, enhancing flexibility and customization in data handling across the application.
Before getting started with mommons, ensure your runtime environment meets the following requirements:
- Programming Language: Java
- Package Manager: Gradle
Install mommons using one of the following methods:
Build from source:
- Clone the mommons repository:
β― git clone https://github.com/itismaku/mommons
- Navigate to the project directory:
β― cd mommons
- Install the project dependencies:
β― gradle build
Run mommons using the following command:
Using gradle
Β
β― gradle run
Run the test suite using the following command:
Using gradle
Β
β― gradle test
- π¬ Join the Discussions: Share your insights, provide feedback, or ask questions.
- π Report Issues: Submit bugs found or log feature requests for the
mommons
project. - π‘ Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/itismaku/mommons
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
This project is protected under the MIT License. For more details, refer to the LICENSE file.