Skip to content

Commit

Permalink
Updated thirdparty-check
Browse files Browse the repository at this point in the history
  • Loading branch information
Th3Shadowbroker committed Jun 2, 2020
1 parent 61d4d25 commit 132eb30
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,15 @@ private void updateConfig() {
}

private void checkForSupportedPlugins() {
if (QuestsSupport.isAvailable()) {
boolean questsInstalled = getServer().getPluginManager().isPluginEnabled(QuestsSupport.PLUGIN_NAME);
if (questsInstalled) {
getLogger().info("Quests support is enabled!");
new QuestsSupport();
}

if (JobsRebornSupport.isAvailable()) {
getLogger().info("JobsReborn support is enabled!");
boolean jobsRebornInstalled = getServer().getPluginManager().isPluginEnabled(JobsRebornSupport.PLUGIN_NAME);
if (jobsRebornInstalled) {
getLogger().info("Jobs support is enabled!");
new JobsRebornSupport();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public class JobsRebornSupport implements Listener {

private static final String PLUGIN_NAME = "Jobs";
public static final String PLUGIN_NAME = "Jobs";

public JobsRebornSupport() {
Bukkit.getPluginManager().registerEvents(this, OuroborosMines.INSTANCE);
Expand All @@ -47,8 +47,4 @@ public void onMaterialMined(MaterialMinedEvent event) {
addProgress(event.getPlayer(), event.getBlock());
}

public static boolean isAvailable() {
return Bukkit.getPluginManager().isPluginEnabled(PLUGIN_NAME);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public class QuestsSupport implements Listener {

private static final String PLUGIN_NAME = "Quests";
public static final String PLUGIN_NAME = "Quests";

public QuestsSupport() {
Bukkit.getPluginManager().registerEvents(this, OuroborosMines.INSTANCE);
Expand Down Expand Up @@ -60,10 +60,6 @@ private void addProgress(Player player, Material material) {
}
}

public static boolean isAvailable() {
return Bukkit.getServer().getPluginManager().isPluginEnabled(PLUGIN_NAME);
}

@EventHandler
public void onMaterialMined(MaterialMinedEvent event) {
addProgress(event.getPlayer(), event.getMaterial().getMaterial());
Expand Down

0 comments on commit 132eb30

Please sign in to comment.