Archiviert
13
0

Expose configuration to plugins.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2014-02-02 19:45:30 +01:00
Ursprung b59f55e2e5
Commit 12286ebaa7
2 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -36,7 +36,7 @@ import com.google.common.io.Files;
*
* @author Kristian
*/
class ProtocolConfig {
public class ProtocolConfig {
private static final String LAST_UPDATE_FILE = "lastupdate";
private static final String SECTION_GLOBAL = "global";

Datei anzeigen

@ -114,6 +114,9 @@ public class ProtocolLibrary extends JavaPlugin {
// Error reporter
private static ErrorReporter reporter = new BasicErrorReporter();
// Strongly typed configuration
private static ProtocolConfig config;
// Metrics and statistisc
private Statistics statistisc;
@ -135,7 +138,6 @@ public class ProtocolLibrary extends JavaPlugin {
// Settings/options
private int configExpectedMod = -1;
private ProtocolConfig config;
// Updater
private Updater updater;
@ -617,6 +619,14 @@ public class ProtocolLibrary extends JavaPlugin {
return reporter;
}
/**
* Retrieve the current strongly typed configuration.
* @return The configuration, or NULL if ProtocolLib hasn't loaded yet.
*/
public static ProtocolConfig getConfiguration() {
return config;
}
/**
* Retrieves the packet protocol manager.
* @return Packet protocol manager, or NULL if it has been disabled.