[10/7/13 9:15 PM]: java.lang.NullPointerException
[10/7/13 9:15 PM]: at server.world.Region.getClipping(Region.java:330)
public static int getClipping(int x, int y, int height) {
if (height > 3)
height = 0;
int regionX = x >> 3;
int regionY = y >> 3;
int regionId = ((regionX / 8) << 8) + (regionY / 8);
330-> for (Region r : regions) {
if (r.id() == regionId) {
return r.getClip(x, y, height);
}
}
return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[10/7/13 9:15 PM]: at server.model.npcs.NPCHandler.handleClipping(NPCHan dle
r.java:1644) ****for this line, there are only spaces, no tabs, could this be the issue******
public void handleClipping(int i) {
NPC npc = npcs[i];
if(npc.moveX == 1 && npc.moveY == 1) {
if((Region.getClipping(npc.absX + 1, npc.absY + 1, npc.heightLevel) & 0x12801e0) != 0) {
npc.moveX = 0; npc.moveY = 0;
if((Region.getClipping(npc.absX, npc.absY + 1, npc.heightLevel) & 0x1280120) == 0)
npc.moveY = 1;
else
npc.moveX = 1;
}
} else if(npc.moveX == -1 && npc.moveY == -1) {
if((Region.getClipping(npc.absX - 1, npc.absY - 1, npc.heightLevel) & 0x128010e) != 0) {
npc.moveX = 0; npc.moveY = 0;
if((Region.getClipping(npc.absX, npc.absY - 1, npc.heightLevel) & 0x1280102) == 0)
npc.moveY = -1;
else
npc.moveX = -1;
}
} else if(npc.moveX == 1 && npc.moveY == -1) {
1644-> if((Region.getClipping(npc.absX + 1, npc.absY - 1, npc.heightLevel) & 0x1280183) != 0) {
npc.moveX = 0; npc.moveY = 0;
if((Region.getClipping(npc.absX, npc.absY - 1, npc.heightLevel) & 0x1280102) == 0)
npc.moveY = -1;
else
npc.moveX = 1;
}
} else if(npc.moveX == -1 && npc.moveY == 1) {
if((Region.getClipping(npc.absX - 1, npc.absY + 1, npc.heightLevel) & 0x128013) != 0) {
npc.moveX = 0; npc.moveY = 0;
if((Region.getClipping(npc.absX, npc.absY + 1, npc.heightLevel) & 0x1280120) == 0)
npc.moveY = 1;
else
npc.moveX = -1;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
[10/7/13 9:15 PM]: at server.model.npcs.NPCHandler.followPlayer(NPCHandl er.
java:1613)
npcs[i].getNextNPCMovement(i);
1613 --->handleClipping(i);
npcs[i].facePlayer(playerId);
npcs[i].updateRequired = true;
}
}
} else {
npcs[i].facePlayer(0);
npcs[i].randomWalk = true;
npcs[i].underAttack = false;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[10/7/13 9:15 PM]: at server.model.npcs.NPCHandler.process(NPCHandler.ja va:
982)
982-----> followPlayer(i, c.playerId);
if (npcs[i] == null)
continue;
if (npcs[i].attackTimer == 0) {
if (c != null) {
attackPlayer(c, i);
} else {
npcs[i].killerId = 0;
npcs[i].underAttack = false;
npcs[i].facePlayer(0);
}
}
} else {
npcs[i].killerId = 0;
npcs[i].underAttack = false;
npcs[i].facePlayer(0);
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
[10/7/13 9:15 PM]: at server.Server.main(Server.java:166)
try {
while (!Server.shutdownServer) {
if (sleepTime >= 0)
Thread.sleep(sleepTime);
else
Thread.sleep(600);
engineTimer.reset();
CycleEventHandler.getSingleton().process();
itemHandler.process();
playerHandler.process();
166-->> npcHandler.process();
shopHandler.process();
objectManager.process();
fightPits.process();
pestControl.process();
cycleTime = engineTimer.elapsed();
sleepTime = cycleRate - cycleTime;
totalCycleTime += cycleTime;
cycles++;
debug();
garbageCollectDelay--;
if (garbageCollectDelay == 0) {
garbageCollectDelay = 40;
System.gc();
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[10/7/13 9:15 PM]: A fatal exception has been thrown!
Press any key to continue . . .