mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
Fix ArrayIndexOutOfBounds error when reading translatable_words file
This commit is contained in:
parent
ebe6db80a1
commit
ad47d98889
@ -168,7 +168,7 @@ public class NameTranslatorManager {
|
||||
Set<String> keys = section.getKeys(false);
|
||||
ListOfNames.clear();
|
||||
for (String one : keys) {
|
||||
String split = one.split("-")[0];
|
||||
String split = one.contains("-") ? one.split("-")[0] : one;
|
||||
String id = split.contains(":") ? split.split(":")[0] : split;
|
||||
String meta = split.contains(":") && split.split(":").length > 1 ? split.split(":")[1] : "";
|
||||
|
||||
@ -186,10 +186,10 @@ public class NameTranslatorManager {
|
||||
Set<String> keys = section.getKeys(false);
|
||||
ListOfEntities.clear();
|
||||
for (String one : keys) {
|
||||
String split = one.split("-")[0];
|
||||
String split = one.contains("-") ? one.split("-")[0] : one;
|
||||
String id = split.contains(":") ? split.split(":")[0] : split;
|
||||
String meta = split.contains(":") ? split.split(":")[1] : "";
|
||||
String MCName = one.split("-")[1];
|
||||
String MCName = one.contains("-") && one.split(":").length > 1 ? one.split("-")[1] : one;
|
||||
String Name = ItemFile.getConfig().getString("EntityList." + one);
|
||||
ListOfEntities.add(new NameList(id, meta, Name, MCName));
|
||||
}
|
||||
@ -229,7 +229,7 @@ public class NameTranslatorManager {
|
||||
Set<String> keys = section.getKeys(false);
|
||||
ListOfColors.clear();
|
||||
for (String one : keys) {
|
||||
String id = one.split("-")[0];
|
||||
String id = one.contains("-") ? one.split("-")[0] : one;
|
||||
String MCName = one.split("-")[1];
|
||||
String Name = ItemFile.getConfig().getString("ColorList." + one);
|
||||
ListOfColors.add(new NameList(id, "", Name, MCName));
|
||||
|
Loading…
Reference in New Issue
Block a user