-
Notifications
You must be signed in to change notification settings - Fork 0
Bump to Version 1.3.2 for Plugin Library Only Stuff #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tance for improved flexibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the library to remove static dependencies on CorePlugin.getInstance() and adopt a dependency injection pattern by passing Plugin instances through constructors. The version is also updated from 1.3.0-SNAPSHOT to 1.3.2-SNAPSHOT, and build configuration has been modified to include shading for the reflections library.
- Refactored manager classes (
ConfigManager,FileManager), utility classes (MySQL), UI components (Menu), and integrations (DiscordApp) to acceptPlugininstances via constructor parameters - Created a new
Pluginclass extendingCorePluginto serve as the main plugin entry point - Updated build configuration to add shading functionality and removed Groovy-based version extraction
- Commented out the entire
WorldManagerclass for future migration to a dev tool
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| paper-plugin.yml | Updated main class reference from CorePlugin to Plugin and changed prefix from "Singularity" to "SingularityLib" |
| CorePlugin.java | Updated ConfigManager instantiations to pass this plugin instance and changed API version to hardcoded "1.3.0" |
| MySQL.java | Added Plugin parameter to constructor and updated all ConfigManager instantiations |
| Menu.java | Removed getInstance() import and replaced static calls with instance field |
| WorldManager.java | Commented out entire implementation with "WIP: Move to Dev tool" note |
| FileManager.java | Changed from static plugin instance to constructor-injected dependency |
| ConfigManager.java | Removed getInstance() dependency, added Plugin parameter to all constructors |
| DiscordApp.java | Added Plugin parameter to constructors for ConfigManager instantiation |
| Plugin.java | New class extending CorePlugin with basic startup/stop message implementations |
| pom.xml | Updated version to 1.3.2-SNAPSHOT, added maven-shade-plugin, removed Groovy plugin configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| } | ||
| } | ||
| // WIP: Move to Dev tool |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Corrected spelling of 'Dev tool' to 'dev tool' for consistency with lowercase naming conventions.
| // WIP: Move to Dev tool | |
| // WIP: Move to dev tool |
| public ConfigManager(Plugin plugin, String fileName) { | ||
| this.plugin = plugin; |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor's Javadoc at line 24-27 does not document the newly added plugin parameter. The documentation should be updated to include @param plugin the plugin instance for accessing the data folder.
| public ConfigManager(Plugin plugin, String subFolder, String fileName) { | ||
| this.plugin = plugin; |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor's Javadoc at line 58-62 does not document the newly added plugin parameter. The documentation should be updated to include @param plugin the plugin instance for accessing the data folder.
| public final Plugin plugin; | ||
|
|
||
| /** | ||
| * Default constructor for FileManager. |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor's Javadoc at line 26-27 does not document the newly added plugin parameter. The documentation should be updated to include @param plugin the plugin instance for accessing the data folder.
| * Default constructor for FileManager. | |
| * Default constructor for FileManager. | |
| * | |
| * @param plugin the plugin instance for accessing the data folder |
| private Plugin plugin; | ||
|
|
||
| /** | ||
| * Default constructor for MySQL utility class. |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor's Javadoc at line 22-24 does not document the newly added plugin parameter. The documentation should be updated to include @param plugin the plugin instance for database operations.
| * Default constructor for MySQL utility class. | |
| * Constructs a MySQL utility class instance. | |
| * @param plugin the plugin instance for database operations |
| public DiscordApp(Plugin plugin, String configPath) { | ||
| this(plugin, configPath, false); |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor's Javadoc at line 32-35 does not document the newly added plugin parameter. The documentation should be updated to include @param plugin the plugin instance.
| public DiscordApp(Plugin plugin, String configPath, boolean multiThread) { | ||
| this.configPath = configPath; | ||
| configManager = new ConfigManager(configPath); | ||
| configManager = new ConfigManager(plugin, configPath); |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor's Javadoc at line 40-45 does not document the newly added plugin parameter. The documentation should be updated to include @param plugin the plugin instance.
| public static boolean isExists(Plugin plugin, String subFolder, String fileName) { | ||
| return new File(plugin.getDataFolder() + "/" + subFolder, fileName).exists(); |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method's Javadoc at line 46-52 does not document the newly added plugin parameter. The documentation should be updated to include @param plugin the plugin instance for accessing the data folder.
No description provided.