Skip to content
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

Update PlaceholderAPI Version and Add Server Status Check #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JobsonMarinho
Copy link

This pull request includes the following updates:

  1. Version Update: The PlaceholderAPI dependency has been updated from version 2.10.6 to 2.11.6 in the pom.xml file. This ensures compatibility with the latest features and bug fixes provided by the new version of the API.
  2. New Feature: Added functionality to check if a specific server is online in the onRequest method. If the identifier starts with online_, the system now verifies the server's status and returns §aOnline if the server is available or §cOffline if it is not.

This update improves compatibility and adds a new feature for checking server statuses dynamically based on the identifier provided.

Comment on lines +99 to +102
if (hasString("online"))
this.online = getString("online", "Online");
if (hasString("offline"))
this.offline = getString("offline", "Offline");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making this extra method, just update the getDefaults() method to include these new entries and it should update accordingly, especially since the getString method returns the default given if returned path is null.

Comment on lines +124 to +130
private boolean hasString(String path) {
ConfigurationSection section = this.getConfigSection();
if (section == null)
return false;
return section.contains(path);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't needed as per the above stated suggestions.

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