@@ -23,6 +23,7 @@ public final class PluginDescriptionFile {
|
||||
private String description = null;
|
||||
private ArrayList<String> authors = new ArrayList<String>();
|
||||
private String website = null;
|
||||
private boolean database = false;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public PluginDescriptionFile(final InputStream stream) throws InvalidDescriptionException {
|
||||
@@ -120,6 +121,14 @@ public final class PluginDescriptionFile {
|
||||
return website;
|
||||
}
|
||||
|
||||
public boolean isDatabaseEnabled() {
|
||||
return database;
|
||||
}
|
||||
|
||||
public void setDatabaseEnabled(boolean database) {
|
||||
this.database = database;
|
||||
}
|
||||
|
||||
private void loadMap(Map<String, Object> map) throws InvalidDescriptionException {
|
||||
try {
|
||||
name = map.get("name").toString();
|
||||
@@ -164,6 +173,14 @@ public final class PluginDescriptionFile {
|
||||
}
|
||||
}
|
||||
|
||||
if (map.containsKey("database")) {
|
||||
try {
|
||||
database = (Boolean)map.get("database");
|
||||
} catch (ClassCastException ex) {
|
||||
throw new InvalidDescriptionException(ex, "database is of wrong type");
|
||||
}
|
||||
}
|
||||
|
||||
if (map.containsKey("website")) {
|
||||
try {
|
||||
website = (String)map.get("website");
|
||||
@@ -204,6 +221,7 @@ public final class PluginDescriptionFile {
|
||||
map.put("name", name);
|
||||
map.put("main", main);
|
||||
map.put("version", version);
|
||||
map.put("database", database);
|
||||
|
||||
if (commands != null) map.put("command", commands);
|
||||
if (depend != null) map.put("depend", depend);
|
||||
|
||||
Reference in New Issue
Block a user