mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-03 23:08:07 +01:00
Don't check title on first run
This commit is contained in:
parent
6344fc0d6b
commit
940115ef71
@ -87,7 +87,7 @@ public class TitleManager {
|
|||||||
ConfigurationSection titleSection = c.getC().getConfigurationSection("Titles");
|
ConfigurationSection titleSection = c.getC().getConfigurationSection("Titles");
|
||||||
if (titleSection == null) {
|
if (titleSection == null) {
|
||||||
titleSection = c.getC().createSection("Titles");
|
titleSection = c.getC().createSection("Titles");
|
||||||
|
|
||||||
this.titles.add(new Title(
|
this.titles.add(new Title(
|
||||||
c.get("Titles.Novice.Name", "N"),
|
c.get("Titles.Novice.Name", "N"),
|
||||||
c.get("Titles.Novice.ShortName", "N"),
|
c.get("Titles.Novice.ShortName", "N"),
|
||||||
@ -143,39 +143,38 @@ public class TitleManager {
|
|||||||
ChatColor.matchColor(c.get("Titles.Legendary.ChatColour", "BLACK")),
|
ChatColor.matchColor(c.get("Titles.Legendary.ChatColour", "BLACK")),
|
||||||
c.get("Titles.Legendary.levelReq", 200),
|
c.get("Titles.Legendary.levelReq", 200),
|
||||||
null));
|
null));
|
||||||
}
|
} else
|
||||||
|
for (String titleKey : titleSection.getKeys(false)) {
|
||||||
|
String jobName = null;
|
||||||
|
String titleName = titleSection.getString(titleKey + ".Name");
|
||||||
|
String titleShortName = titleSection.getString(titleKey + ".ShortName");
|
||||||
|
ChatColor titleColor = ChatColor.matchColor(titleSection.getString(titleKey + ".ChatColour", ""));
|
||||||
|
int levelReq = titleSection.getInt(titleKey + ".levelReq", -1);
|
||||||
|
|
||||||
for (String titleKey : titleSection.getKeys(false)) {
|
if (titleSection.isString(titleKey + ".JobName")) {
|
||||||
String jobName = null;
|
jobName = titleSection.getString(titleKey + ".JobName");
|
||||||
String titleName = titleSection.getString(titleKey + ".Name");
|
}
|
||||||
String titleShortName = titleSection.getString(titleKey + ".ShortName");
|
|
||||||
ChatColor titleColor = ChatColor.matchColor(titleSection.getString(titleKey + ".ChatColour", ""));
|
|
||||||
int levelReq = titleSection.getInt(titleKey + ".levelReq", -1);
|
|
||||||
|
|
||||||
if (titleSection.isString(titleKey + ".JobName")) {
|
if (titleName == null) {
|
||||||
jobName = titleSection.getString(titleKey + ".JobName");
|
Jobs.getPluginLogger().severe("Title " + titleKey + " has an invalid Name property. Skipping!");
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (titleName == null) {
|
if (titleShortName == null) {
|
||||||
Jobs.getPluginLogger().severe("Title " + titleKey + " has an invalid Name property. Skipping!");
|
Jobs.getPluginLogger().severe("Title " + titleKey + " has an invalid ShortName property. Skipping!");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (titleColor == null) {
|
||||||
|
Jobs.getPluginLogger().severe("Title " + titleKey + " has an invalid ChatColour property. Skipping!");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (levelReq <= -1) {
|
||||||
|
Jobs.getPluginLogger().severe("Title " + titleKey + " has an invalid levelReq property. Skipping!");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (titleShortName == null) {
|
this.titles.add(new Title(titleName, titleShortName, titleColor, levelReq, jobName));
|
||||||
Jobs.getPluginLogger().severe("Title " + titleKey + " has an invalid ShortName property. Skipping!");
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if (titleColor == null) {
|
|
||||||
Jobs.getPluginLogger().severe("Title " + titleKey + "has an invalid ChatColour property. Skipping!");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (levelReq <= -1) {
|
|
||||||
Jobs.getPluginLogger().severe("Title " + titleKey + " has an invalid levelReq property. Skipping!");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.titles.add(new Title(titleName, titleShortName, titleColor, levelReq, jobName));
|
|
||||||
}
|
|
||||||
|
|
||||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + titles.size() + " titles!");
|
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + titles.size() + " titles!");
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user