Not sure why i get this, here is the exception:
Exception in thread "main" java.lang.NullPointerException
at org.dementhium.model.definition.ItemDefinition.loadMiscData(ItemDefinition.java:126)
at org.dementhium.model.definition.ItemDefinition.init(ItemDefinition.java:104)
at org.dementhium.model.World.load(World.java:127)
at org.dementhium.RS2ServerBootstrap.main(RS2ServerBootstrap.java:43)
here is my loadmiscdata method:
private static void loadMiscData() throws IOException {
BufferedReader reader = new BufferedReader(new FileReader("data/item/poisoningitems.txt"));
String string;
while ((string = reader.readLine()) != null) {
String[] data = string.split(":");
int id = Integer.parseInt(data[0]);
int amount = Integer.parseInt(data[1]);
definitions[id].setPoisonAmount(amount);
}
reader = new BufferedReader(new FileReader("data/item/equipIds.txt"));
while ((string = reader.readLine()) != null) {
String[] data = string.split(":");
int id = Integer.parseInt(data[0]);
int equipId = Integer.parseInt(data[1]);
definitions[id].setEquipId(equipId);
}
}
line 126:
definitions[id].setEquipId(equipId);
here is part of my equipids file(wont post all because its huge):
20282:5106
20284:5107
20288:5108
20290:5109
20294:5110
20296:5111
20300:5112
20302:5113
20306:5114
20308:5115
20312:5116
20314:5117
20318:5118
20320:5119
20324:5120
20326:5121
20330:5122
20332:5123
20336:5124
20338:5125
20342:5126
20344:5127
I have no idea why i am getting this exception...
Thanks in advance :)
Sorry i forgot to post definitions here it is:
private static ItemDefinition[] definitions;
definitions = new ItemDefinition[MAX_SIZE];
MAX_SIZE = 20792 btw
for the entire class look here: http://pastebin.com/rvyMp42q
Thanks again