mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-25 12:05:14 +01:00
Prevented properties from getting null if they were invalid in worlds.yml
This commit is contained in:
parent
c0ae0e3eea
commit
c9cd2a0f5c
@ -17,11 +17,7 @@ public class BooleanConfigProperty implements MVConfigProperty<Boolean> {
|
||||
private String help;
|
||||
|
||||
public BooleanConfigProperty(ConfigurationSection section, String name, Boolean defaultValue, String help) {
|
||||
this.name = name;
|
||||
this.configNode = name;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.setValue(this.section.getBoolean(this.configNode, defaultValue));
|
||||
this(section, name, defaultValue, name, help);
|
||||
}
|
||||
|
||||
public BooleanConfigProperty(ConfigurationSection section, String name, Boolean defaultValue, String configNode, String help) {
|
||||
@ -29,6 +25,7 @@ public class BooleanConfigProperty implements MVConfigProperty<Boolean> {
|
||||
this.configNode = configNode;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.value = defaultValue;
|
||||
this.setValue(this.section.getBoolean(this.configNode, defaultValue));
|
||||
}
|
||||
|
||||
|
@ -18,11 +18,7 @@ public class ColorConfigProperty implements MVConfigProperty<EnglishChatColor> {
|
||||
private String help;
|
||||
|
||||
public ColorConfigProperty(ConfigurationSection section, String name, EnglishChatColor defaultValue, String help) {
|
||||
this.name = name;
|
||||
this.configNode = name;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
||||
this(section, name, defaultValue, name, help);
|
||||
}
|
||||
|
||||
public ColorConfigProperty(ConfigurationSection section, String name, EnglishChatColor defaultValue, String configNode, String help) {
|
||||
@ -30,6 +26,7 @@ public class ColorConfigProperty implements MVConfigProperty<EnglishChatColor> {
|
||||
this.configNode = configNode;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.value = defaultValue;
|
||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
||||
}
|
||||
|
||||
|
@ -18,11 +18,7 @@ public class DifficultyConfigProperty implements MVConfigProperty<Difficulty> {
|
||||
private String help;
|
||||
|
||||
public DifficultyConfigProperty(ConfigurationSection section, String name, Difficulty defaultValue, String help) {
|
||||
this.name = name;
|
||||
this.configNode = name;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
||||
this(section, name, defaultValue, name, help);
|
||||
}
|
||||
|
||||
public DifficultyConfigProperty(ConfigurationSection section, String name, Difficulty defaultValue, String configNode, String help) {
|
||||
@ -30,6 +26,7 @@ public class DifficultyConfigProperty implements MVConfigProperty<Difficulty> {
|
||||
this.configNode = configNode;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.value = defaultValue;
|
||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,7 @@ public class DoubleConfigProperty implements MVConfigProperty<Double> {
|
||||
private String help;
|
||||
|
||||
public DoubleConfigProperty(ConfigurationSection section, String name, Double defaultValue, String help) {
|
||||
this.name = name;
|
||||
this.configNode = name;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.setValue(this.section.getDouble(this.configNode, defaultValue));
|
||||
this(section, name, defaultValue, name, help);
|
||||
}
|
||||
|
||||
public DoubleConfigProperty(ConfigurationSection section, String name, Double defaultValue, String configNode, String help) {
|
||||
@ -29,6 +25,7 @@ public class DoubleConfigProperty implements MVConfigProperty<Double> {
|
||||
this.configNode = configNode;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.value = defaultValue;
|
||||
this.setValue(this.section.getDouble(this.configNode, defaultValue));
|
||||
}
|
||||
|
||||
|
@ -18,11 +18,7 @@ public class GameModeConfigProperty implements MVConfigProperty<GameMode> {
|
||||
private String help;
|
||||
|
||||
public GameModeConfigProperty(ConfigurationSection section, String name, GameMode defaultValue, String help) {
|
||||
this.name = name;
|
||||
this.configNode = name;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
||||
this(section, name, defaultValue, name, help);
|
||||
}
|
||||
|
||||
public GameModeConfigProperty(ConfigurationSection section, String name, GameMode defaultValue, String configNode, String help) {
|
||||
@ -30,6 +26,7 @@ public class GameModeConfigProperty implements MVConfigProperty<GameMode> {
|
||||
this.configNode = configNode;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.value = defaultValue;
|
||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,7 @@ public class IntegerConfigProperty implements MVConfigProperty<Integer> {
|
||||
private String help;
|
||||
|
||||
public IntegerConfigProperty(ConfigurationSection section, String name, Integer defaultValue, String help) {
|
||||
this.name = name;
|
||||
this.configNode = name;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.setValue(this.section.getInt(this.configNode, defaultValue));
|
||||
this(section, name, defaultValue, name, help);
|
||||
}
|
||||
|
||||
public IntegerConfigProperty(ConfigurationSection section, String name, Integer defaultValue, String configNode, String help) {
|
||||
@ -29,6 +25,7 @@ public class IntegerConfigProperty implements MVConfigProperty<Integer> {
|
||||
this.configNode = configNode;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.value = defaultValue;
|
||||
this.setValue(this.section.getInt(this.configNode, defaultValue));
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,7 @@ public class LocationConfigProperty implements MVConfigProperty<Location> {
|
||||
private String help;
|
||||
|
||||
public LocationConfigProperty(ConfigurationSection section, String name, Location defaultValue, String help) {
|
||||
this.name = name;
|
||||
this.configNode = name;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.setValue(this.getLocationFromConfig(defaultValue));
|
||||
this(section, name, defaultValue, name, help);
|
||||
}
|
||||
|
||||
public LocationConfigProperty(ConfigurationSection section, String name, Location defaultValue, String configNode, String help) {
|
||||
@ -31,6 +27,7 @@ public class LocationConfigProperty implements MVConfigProperty<Location> {
|
||||
this.configNode = configNode;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.value = defaultValue;
|
||||
this.setValue(this.getLocationFromConfig(defaultValue));
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,7 @@ public class StringConfigProperty implements MVConfigProperty<String> {
|
||||
private String help;
|
||||
|
||||
public StringConfigProperty(ConfigurationSection section, String name, String defaultValue, String help) {
|
||||
this.name = name;
|
||||
this.configNode = name;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.parseValue(this.section.getString(this.configNode, defaultValue));
|
||||
this(section, name, defaultValue, defaultValue, help);
|
||||
}
|
||||
|
||||
public StringConfigProperty(ConfigurationSection section, String name, String defaultValue, String configNode, String help) {
|
||||
@ -29,6 +25,7 @@ public class StringConfigProperty implements MVConfigProperty<String> {
|
||||
this.configNode = configNode;
|
||||
this.section = section;
|
||||
this.help = help;
|
||||
this.value = defaultValue;
|
||||
this.parseValue(this.section.getString(this.configNode, defaultValue));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user