Expose configuration to plugins.
Dieser Commit ist enthalten in:
Ursprung
b59f55e2e5
Commit
12286ebaa7
@ -36,7 +36,7 @@ import com.google.common.io.Files;
|
|||||||
*
|
*
|
||||||
* @author Kristian
|
* @author Kristian
|
||||||
*/
|
*/
|
||||||
class ProtocolConfig {
|
public class ProtocolConfig {
|
||||||
private static final String LAST_UPDATE_FILE = "lastupdate";
|
private static final String LAST_UPDATE_FILE = "lastupdate";
|
||||||
|
|
||||||
private static final String SECTION_GLOBAL = "global";
|
private static final String SECTION_GLOBAL = "global";
|
||||||
|
@ -114,6 +114,9 @@ public class ProtocolLibrary extends JavaPlugin {
|
|||||||
// Error reporter
|
// Error reporter
|
||||||
private static ErrorReporter reporter = new BasicErrorReporter();
|
private static ErrorReporter reporter = new BasicErrorReporter();
|
||||||
|
|
||||||
|
// Strongly typed configuration
|
||||||
|
private static ProtocolConfig config;
|
||||||
|
|
||||||
// Metrics and statistisc
|
// Metrics and statistisc
|
||||||
private Statistics statistisc;
|
private Statistics statistisc;
|
||||||
|
|
||||||
@ -135,7 +138,6 @@ public class ProtocolLibrary extends JavaPlugin {
|
|||||||
|
|
||||||
// Settings/options
|
// Settings/options
|
||||||
private int configExpectedMod = -1;
|
private int configExpectedMod = -1;
|
||||||
private ProtocolConfig config;
|
|
||||||
|
|
||||||
// Updater
|
// Updater
|
||||||
private Updater updater;
|
private Updater updater;
|
||||||
@ -617,6 +619,14 @@ public class ProtocolLibrary extends JavaPlugin {
|
|||||||
return reporter;
|
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.
|
* Retrieves the packet protocol manager.
|
||||||
* @return Packet protocol manager, or NULL if it has been disabled.
|
* @return Packet protocol manager, or NULL if it has been disabled.
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren