mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-13 11:15:57 -07:00
@@ -196,4 +196,24 @@ public class Configuration {
|
|||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a boolean at a location. This will either return an boolean
|
||||||
|
* or the default value. If the object at the particular location is not
|
||||||
|
* actually a boolean, the default value will be returned.
|
||||||
|
*
|
||||||
|
* @param path SK's dot notation supported
|
||||||
|
* @param def default value
|
||||||
|
* @return boolean or default
|
||||||
|
*/
|
||||||
|
public boolean getBoolean(String path, boolean def) {
|
||||||
|
Object o = getProperty(path);
|
||||||
|
if (o == null) {
|
||||||
|
return def;
|
||||||
|
} else if (o instanceof Boolean) {
|
||||||
|
return (Boolean)o;
|
||||||
|
} else {
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user