Recently, I have cache packed 634 items and all the newer items say "Unarmed".
LoadItemList
Code:
public boolean loadItemList(String FileName) {
String line = "";
String token = "";
String token2 = "";
String token2_2 = "";
String[] token3 = new String[10];
boolean EndOfFile = false;
BufferedReader characterfile = null;
try {
characterfile = new BufferedReader(new FileReader("./Data/cfg/"
+ FileName));
} catch (FileNotFoundException fileex) {
Misc.println(FileName + ": file not found.");
return false;
}
try {
line = characterfile.readLine();
} catch (IOException ioexception) {
Misc.println(FileName + ": error loading file.");
}
while (EndOfFile == false && line != null) {
line = line.trim();
int spot = line.indexOf("=");
if (spot > -1) {
token = line.substring(0, spot);
token = token.trim();
token2 = line.substring(spot + 1);
token2 = token2.trim();
token2_2 = token2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token3 = token2_2.split("\t");
if (token.equals("item")) {
int[] Bonuses = new int[12];
for (int i = 0; i < 12; i++) {
if (token3[(6 + i)] != null) {
Bonuses[i] = Integer.parseInt(token3[(6 + i)]);
} else {
break;
}
}
newItemList(Integer.parseInt(token3[0]),
token3[1].replaceAll("_", " "),
token3[2].replaceAll("_", " "),
Double.parseDouble(token3[4]),
Double.parseDouble(token3[4]),
Double.parseDouble(token3[6]), Bonuses);
}
} else {
if (line.equals("[ENDOFITEMLIST]")) {
try {
characterfile.close();
} catch (IOException ioexception) {
}
}
}
try {
line = characterfile.readLine();
} catch (IOException ioexception1) {
EndOfFile = true;
}
}
try {
characterfile.close();
} catch (IOException ioexception) {
}
return false;
}
Item.cfg some as an example
Code:
item = 18353 Chaotic_maul A_maul_used_to_claim_life_from_those_who_don't_deserve_it. 0 0 0 -4 -4 167 0 0 0 0 0 0 0 155 0
item = 18354 Chaotic_maul_(broken) A_maul_used_to_claim_life_from_those_who_don't_deserve_it. 0 0 0 -4 -4 167 0 0 0 0 0 0 0 155 0
item = 18355 Chaotic_staff This_staff_makes_destructive_spells_more_powerful. 0 0 0 0 -1 65 18 0 5 7 4 18 0 72 0
item = 18356 Chaotic_staff_(broken) This_staff_makes_destructive_spells_more_powerful. 0 0 0 0 -1 65 18 0 5 7 4 18 0 72 0
item = 18357 Chaotic_c'bow A_small_c'bow,_only_effective_at_short_distance. 0 0 0 0 0 0 0 120 0 0 0 0 0 0 0
item = 18358 Chaotic_c'bow_(broken) A_small_c'bow,_only_effective_at_short_distance. 0 0 0 0 0 0 0 120 0 0 0 0 0 0 0
item = 18359 Chaotic_kiteshield A_large_metal_shield. 0 0 0 2 0 4 -15 0 83 90 86 -5 89 0 0
item = 18360 Chaotic_kiteshield_(broken) A_large_metal_shield. 0 0 0 2 0 4 -15 0 83 90 86 -5 89 0 0
item = 18361 Eagle-eye_kiteshield Eagleeye 0 0 0 -5 -5 -5 0 4 50 50 70 25 50 0 0