mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-07 16:49:10 +00:00
Merge branch 'development' into cleanup/classredirect
This commit is contained in:
@@ -12,11 +12,9 @@ import java.util.LinkedList;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Initializes the bot environment
|
||||||
*
|
*
|
||||||
* Initiliazes the bot environment
|
* @author Everel, JKetelaar
|
||||||
*
|
|
||||||
* @author Everel
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class Environment {
|
public class Environment {
|
||||||
|
|
||||||
@@ -31,21 +29,32 @@ public class Environment {
|
|||||||
libs.add(new JavaFX());
|
libs.add(new JavaFX());
|
||||||
|
|
||||||
for (Library lib : libs) {
|
for (Library lib : libs) {
|
||||||
if (lib.requiresJar()) {
|
loadLibrary(lib, true);
|
||||||
if (!lib.hasJar()) {
|
|
||||||
Core.verbose("Downloading " + lib.getLibraryName() + "...");
|
|
||||||
VerboseLoader.setState("Downloading " + lib.getLibraryName() + "...");
|
|
||||||
WebUtil.downloadFile(lib.getDownloadLink(), lib.getJarFile(), VerboseLoader.get());
|
|
||||||
Core.verbose("Downloaded " + lib.getLibraryName() + ".");
|
|
||||||
}
|
|
||||||
Core.verbose("Initializing " + lib.getLibraryName());
|
|
||||||
lib.init();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Core.verbose("Loading server: " + desc.toString() + "...");
|
Core.verbose("Loading server: " + desc.toString() + "...");
|
||||||
|
|
||||||
ServerParser.SERVER_CACHE.get(desc).run();
|
ServerParser.SERVER_CACHE.get(desc).run();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads library into environment
|
||||||
|
*
|
||||||
|
* @param library
|
||||||
|
* @param verboseLoader defines if verboseLoader should be enabled
|
||||||
|
*/
|
||||||
|
public static void loadLibrary(Library library, boolean verboseLoader) {
|
||||||
|
if (library.requiresJar()) {
|
||||||
|
if (!library.hasJar()) {
|
||||||
|
Core.verbose("Downloading " + library.getLibraryName() + "...");
|
||||||
|
if (verboseLoader) {
|
||||||
|
VerboseLoader.setState("Downloading " + library.getLibraryName() + "...");
|
||||||
|
}
|
||||||
|
WebUtil.downloadFile(library.getDownloadLink(), library.getJarFile(), VerboseLoader.get());
|
||||||
|
Core.verbose("Downloaded " + library.getLibraryName() + ".");
|
||||||
|
}
|
||||||
|
Core.verbose("Initializing " + library.getLibraryName());
|
||||||
|
library.init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user