mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Made BiomeMapParser public
This commit is contained in:
parent
e6786b4023
commit
ecdf4f939c
@ -33,7 +33,7 @@ import io.github.thebusybiscuit.slimefun4.utils.PatternUtils;
|
|||||||
*
|
*
|
||||||
* @see BiomeMap
|
* @see BiomeMap
|
||||||
*/
|
*/
|
||||||
class BiomeMapParser<T> {
|
public class BiomeMapParser<T> {
|
||||||
|
|
||||||
private static final String VALUE_KEY = "value";
|
private static final String VALUE_KEY = "value";
|
||||||
private static final String BIOMES_KEY = "biomes";
|
private static final String BIOMES_KEY = "biomes";
|
||||||
@ -61,7 +61,7 @@ class BiomeMapParser<T> {
|
|||||||
* A function to convert {@link JsonElement}s into your desired data type
|
* A function to convert {@link JsonElement}s into your desired data type
|
||||||
*/
|
*/
|
||||||
@ParametersAreNonnullByDefault
|
@ParametersAreNonnullByDefault
|
||||||
BiomeMapParser(NamespacedKey key, BiomeDataConverter<T> valueConverter) {
|
public BiomeMapParser(NamespacedKey key, BiomeDataConverter<T> valueConverter) {
|
||||||
Validate.notNull(key, "The key shall not be null.");
|
Validate.notNull(key, "The key shall not be null.");
|
||||||
Validate.notNull(valueConverter, "You must provide a Function to convert raw json values to your desired data type.");
|
Validate.notNull(valueConverter, "You must provide a Function to convert raw json values to your desired data type.");
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ class BiomeMapParser<T> {
|
|||||||
* @param isLenient
|
* @param isLenient
|
||||||
* Whether this parser should be lenient or not.
|
* Whether this parser should be lenient or not.
|
||||||
*/
|
*/
|
||||||
void setLenient(boolean isLenient) {
|
public void setLenient(boolean isLenient) {
|
||||||
this.isLenient = isLenient;
|
this.isLenient = isLenient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,11 +92,11 @@ class BiomeMapParser<T> {
|
|||||||
*
|
*
|
||||||
* @return Whether this parser is lenient or not.
|
* @return Whether this parser is lenient or not.
|
||||||
*/
|
*/
|
||||||
boolean isLenient() {
|
public boolean isLenient() {
|
||||||
return isLenient;
|
return isLenient;
|
||||||
}
|
}
|
||||||
|
|
||||||
void read(@Nonnull String json) throws BiomeMapException {
|
public void read(@Nonnull String json) throws BiomeMapException {
|
||||||
Validate.notNull(json, "The JSON string should not be null!");
|
Validate.notNull(json, "The JSON string should not be null!");
|
||||||
JsonArray root = null;
|
JsonArray root = null;
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ class BiomeMapParser<T> {
|
|||||||
read(root);
|
read(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
void read(@Nonnull JsonArray json) throws BiomeMapException {
|
public void read(@Nonnull JsonArray json) throws BiomeMapException {
|
||||||
Validate.notNull(json, "The JSON Array should not be null!");
|
Validate.notNull(json, "The JSON Array should not be null!");
|
||||||
|
|
||||||
for (JsonElement element : json) {
|
for (JsonElement element : json) {
|
||||||
@ -200,7 +200,7 @@ class BiomeMapParser<T> {
|
|||||||
* @return The resulting {@link BiomeMap}
|
* @return The resulting {@link BiomeMap}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
BiomeMap<T> buildBiomeMap() {
|
public BiomeMap<T> buildBiomeMap() {
|
||||||
BiomeMap<T> biomeMap = new BiomeMap<>(key);
|
BiomeMap<T> biomeMap = new BiomeMap<>(key);
|
||||||
biomeMap.putAll(map);
|
biomeMap.putAll(map);
|
||||||
return biomeMap;
|
return biomeMap;
|
||||||
|
Loading…
Reference in New Issue
Block a user