Skip to content

Conversation

@Pinont
Copy link
Owner

@Pinont Pinont commented Nov 6, 2025

No description provided.

@Pinont Pinont requested a review from Copilot November 6, 2025 10:18
@Pinont Pinont merged commit ea992c4 into main Nov 6, 2025
8 checks passed
Copy link

Copilot AI left a 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 accept Plugin instances via constructor parameters
  • Created a new Plugin class extending CorePlugin to serve as the main plugin entry point
  • Updated build configuration to add shading functionality and removed Groovy-based version extraction
  • Commented out the entire WorldManager class 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
Copy link

Copilot AI Nov 6, 2025

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.

Suggested change
// WIP: Move to Dev tool
// WIP: Move to dev tool

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +29
public ConfigManager(Plugin plugin, String fileName) {
this.plugin = plugin;
Copy link

Copilot AI Nov 6, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +63 to +64
public ConfigManager(Plugin plugin, String subFolder, String fileName) {
this.plugin = plugin;
Copy link

Copilot AI Nov 6, 2025

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.

Copilot uses AI. Check for mistakes.
public final Plugin plugin;

/**
* Default constructor for FileManager.
Copy link

Copilot AI Nov 6, 2025

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.

Suggested change
* Default constructor for FileManager.
* Default constructor for FileManager.
*
* @param plugin the plugin instance for accessing the data folder

Copilot uses AI. Check for mistakes.
private Plugin plugin;

/**
* Default constructor for MySQL utility class.
Copy link

Copilot AI Nov 6, 2025

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.

Suggested change
* Default constructor for MySQL utility class.
* Constructs a MySQL utility class instance.
* @param plugin the plugin instance for database operations

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +37
public DiscordApp(Plugin plugin, String configPath) {
this(plugin, configPath, false);
Copy link

Copilot AI Nov 6, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +48
public DiscordApp(Plugin plugin, String configPath, boolean multiThread) {
this.configPath = configPath;
configManager = new ConfigManager(configPath);
configManager = new ConfigManager(plugin, configPath);
Copy link

Copilot AI Nov 6, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +54
public static boolean isExists(Plugin plugin, String subFolder, String fileName) {
return new File(plugin.getDataFolder() + "/" + subFolder, fileName).exists();
Copy link

Copilot AI Nov 6, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants