This commit is contained in:
darbyjack 2018-09-11 02:01:02 -05:00
parent 7d346f9320
commit cbeab9027a
2 changed files with 12 additions and 2 deletions

View File

@ -71,7 +71,7 @@ public final class CitizensCMD extends JavaPlugin {
private static HashMap<String, Boolean> waitingList; private static HashMap<String, Boolean> waitingList;
public void onLoad() { public void onLoad() {
if (!hasCitizens()) { if (!hasCitizensFile()) {
info(color(TAG + "&cCitizens &7is needed for this plugin to work!")); info(color(TAG + "&cCitizens &7is needed for this plugin to work!"));
info(color(TAG + "&cCitizens.jar &7is not installed on the server!")); info(color(TAG + "&cCitizens.jar &7is not installed on the server!"));
info(color(TAG + "&cDownloading Citizens jar...")); info(color(TAG + "&cDownloading Citizens jar..."));
@ -81,7 +81,7 @@ public final class CitizensCMD extends JavaPlugin {
public void onEnable() { public void onEnable() {
Util.loadCitizens(); if (!hasCitizens()) Util.loadCitizens();
plugin = this; plugin = this;
@ -227,6 +227,10 @@ public final class CitizensCMD extends JavaPlugin {
* *
* @return Returns true if Citizens is found and false if not * @return Returns true if Citizens is found and false if not
*/ */
private boolean hasCitizensFile() {
return Util.doesCitizensExist();
}
private boolean hasCitizens() { private boolean hasCitizens() {
return Bukkit.getPluginManager().isPluginEnabled("Citizens"); return Bukkit.getPluginManager().isPluginEnabled("Citizens");
} }

View File

@ -271,4 +271,10 @@ public class Util {
e.printStackTrace(); e.printStackTrace();
} }
} }
public static boolean doesCitizensExist() {
File pluginFolder = Bukkit.getServer().getUpdateFolderFile().getParentFile();
File citizens = new File(pluginFolder, "Citizens.jar");
return citizens.exists();
}
} }