mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-25 20:16:06 +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;
|
private String help;
|
||||||
|
|
||||||
public BooleanConfigProperty(ConfigurationSection section, String name, Boolean defaultValue, String help) {
|
public BooleanConfigProperty(ConfigurationSection section, String name, Boolean defaultValue, String help) {
|
||||||
this.name = name;
|
this(section, name, defaultValue, name, help);
|
||||||
this.configNode = name;
|
|
||||||
this.section = section;
|
|
||||||
this.help = help;
|
|
||||||
this.setValue(this.section.getBoolean(this.configNode, defaultValue));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BooleanConfigProperty(ConfigurationSection section, String name, Boolean defaultValue, String configNode, String 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.configNode = configNode;
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.help = help;
|
this.help = help;
|
||||||
|
this.value = defaultValue;
|
||||||
this.setValue(this.section.getBoolean(this.configNode, defaultValue));
|
this.setValue(this.section.getBoolean(this.configNode, defaultValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,11 +18,7 @@ public class ColorConfigProperty implements MVConfigProperty<EnglishChatColor> {
|
|||||||
private String help;
|
private String help;
|
||||||
|
|
||||||
public ColorConfigProperty(ConfigurationSection section, String name, EnglishChatColor defaultValue, String help) {
|
public ColorConfigProperty(ConfigurationSection section, String name, EnglishChatColor defaultValue, String help) {
|
||||||
this.name = name;
|
this(section, name, defaultValue, name, help);
|
||||||
this.configNode = name;
|
|
||||||
this.section = section;
|
|
||||||
this.help = help;
|
|
||||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ColorConfigProperty(ConfigurationSection section, String name, EnglishChatColor defaultValue, String configNode, String 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.configNode = configNode;
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.help = help;
|
this.help = help;
|
||||||
|
this.value = defaultValue;
|
||||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,11 +18,7 @@ public class DifficultyConfigProperty implements MVConfigProperty<Difficulty> {
|
|||||||
private String help;
|
private String help;
|
||||||
|
|
||||||
public DifficultyConfigProperty(ConfigurationSection section, String name, Difficulty defaultValue, String help) {
|
public DifficultyConfigProperty(ConfigurationSection section, String name, Difficulty defaultValue, String help) {
|
||||||
this.name = name;
|
this(section, name, defaultValue, name, help);
|
||||||
this.configNode = name;
|
|
||||||
this.section = section;
|
|
||||||
this.help = help;
|
|
||||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DifficultyConfigProperty(ConfigurationSection section, String name, Difficulty defaultValue, String configNode, String 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.configNode = configNode;
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.help = help;
|
this.help = help;
|
||||||
|
this.value = defaultValue;
|
||||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,11 +17,7 @@ public class DoubleConfigProperty implements MVConfigProperty<Double> {
|
|||||||
private String help;
|
private String help;
|
||||||
|
|
||||||
public DoubleConfigProperty(ConfigurationSection section, String name, Double defaultValue, String help) {
|
public DoubleConfigProperty(ConfigurationSection section, String name, Double defaultValue, String help) {
|
||||||
this.name = name;
|
this(section, name, defaultValue, name, help);
|
||||||
this.configNode = name;
|
|
||||||
this.section = section;
|
|
||||||
this.help = help;
|
|
||||||
this.setValue(this.section.getDouble(this.configNode, defaultValue));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DoubleConfigProperty(ConfigurationSection section, String name, Double defaultValue, String configNode, String 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.configNode = configNode;
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.help = help;
|
this.help = help;
|
||||||
|
this.value = defaultValue;
|
||||||
this.setValue(this.section.getDouble(this.configNode, defaultValue));
|
this.setValue(this.section.getDouble(this.configNode, defaultValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,11 +18,7 @@ public class GameModeConfigProperty implements MVConfigProperty<GameMode> {
|
|||||||
private String help;
|
private String help;
|
||||||
|
|
||||||
public GameModeConfigProperty(ConfigurationSection section, String name, GameMode defaultValue, String help) {
|
public GameModeConfigProperty(ConfigurationSection section, String name, GameMode defaultValue, String help) {
|
||||||
this.name = name;
|
this(section, name, defaultValue, name, help);
|
||||||
this.configNode = name;
|
|
||||||
this.section = section;
|
|
||||||
this.help = help;
|
|
||||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameModeConfigProperty(ConfigurationSection section, String name, GameMode defaultValue, String configNode, String 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.configNode = configNode;
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.help = help;
|
this.help = help;
|
||||||
|
this.value = defaultValue;
|
||||||
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
this.parseValue(this.section.getString(this.configNode, defaultValue.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,11 +17,7 @@ public class IntegerConfigProperty implements MVConfigProperty<Integer> {
|
|||||||
private String help;
|
private String help;
|
||||||
|
|
||||||
public IntegerConfigProperty(ConfigurationSection section, String name, Integer defaultValue, String help) {
|
public IntegerConfigProperty(ConfigurationSection section, String name, Integer defaultValue, String help) {
|
||||||
this.name = name;
|
this(section, name, defaultValue, name, help);
|
||||||
this.configNode = name;
|
|
||||||
this.section = section;
|
|
||||||
this.help = help;
|
|
||||||
this.setValue(this.section.getInt(this.configNode, defaultValue));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntegerConfigProperty(ConfigurationSection section, String name, Integer defaultValue, String configNode, String 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.configNode = configNode;
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.help = help;
|
this.help = help;
|
||||||
|
this.value = defaultValue;
|
||||||
this.setValue(this.section.getInt(this.configNode, defaultValue));
|
this.setValue(this.section.getInt(this.configNode, defaultValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,11 +19,7 @@ public class LocationConfigProperty implements MVConfigProperty<Location> {
|
|||||||
private String help;
|
private String help;
|
||||||
|
|
||||||
public LocationConfigProperty(ConfigurationSection section, String name, Location defaultValue, String help) {
|
public LocationConfigProperty(ConfigurationSection section, String name, Location defaultValue, String help) {
|
||||||
this.name = name;
|
this(section, name, defaultValue, name, help);
|
||||||
this.configNode = name;
|
|
||||||
this.section = section;
|
|
||||||
this.help = help;
|
|
||||||
this.setValue(this.getLocationFromConfig(defaultValue));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocationConfigProperty(ConfigurationSection section, String name, Location defaultValue, String configNode, String 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.configNode = configNode;
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.help = help;
|
this.help = help;
|
||||||
|
this.value = defaultValue;
|
||||||
this.setValue(this.getLocationFromConfig(defaultValue));
|
this.setValue(this.getLocationFromConfig(defaultValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,11 +17,7 @@ public class StringConfigProperty implements MVConfigProperty<String> {
|
|||||||
private String help;
|
private String help;
|
||||||
|
|
||||||
public StringConfigProperty(ConfigurationSection section, String name, String defaultValue, String help) {
|
public StringConfigProperty(ConfigurationSection section, String name, String defaultValue, String help) {
|
||||||
this.name = name;
|
this(section, name, defaultValue, defaultValue, help);
|
||||||
this.configNode = name;
|
|
||||||
this.section = section;
|
|
||||||
this.help = help;
|
|
||||||
this.parseValue(this.section.getString(this.configNode, defaultValue));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringConfigProperty(ConfigurationSection section, String name, String defaultValue, String configNode, String 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.configNode = configNode;
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.help = help;
|
this.help = help;
|
||||||
|
this.value = defaultValue;
|
||||||
this.parseValue(this.section.getString(this.configNode, defaultValue));
|
this.parseValue(this.section.getString(this.configNode, defaultValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user