Post your mineOre method. (Point out line 63 of the Mining class as well, should be in the mineOre method.)
|
|
Ok so i've just added the 90% mining on my server, and this is what i get:
Any help on what to fix please?Code:Exception encountered while parsing incoming packets from Skin. java.lang.ArrayIndexOutOfBoundsException: -10 at Mining.mineOre(Mining.java:63) at client.parseIncomingPackets(client.java:12904) at client.packetProcess(client.java:17109) at PlayerHandler.process(PlayerHandler.java:268) at process.run(process.java:23) at java.lang.Thread.run(Unknown Source)
line 63 + mineOre method:
2nd debug, requested by Impulser.Code://Starts initial Mine public void mineOre(int rock) { int index = Arrays.binarySearch(rocks, rock); if(index != -1) { if (c.playerLevel[c.playerMining] < miningInfo[index][1]) { c.sM("You don't have high enough level to mine this rock!"); return; } mineOre = miningInfo[index][0]; mineExp = 4*miningInfo[index][2]; beginMine(rock); } }
Code:DEBUG: c.playerMining = 14, index = -10 Exception encountered while parsing incoming packets from Skin. java.lang.ArrayIndexOutOfBoundsException: -10 at Mining.mineOre(Mining.java:65) at client.parseIncomingPackets(client.java:12904) at client.packetProcess(client.java:17109) at PlayerHandler.process(PlayerHandler.java:268) at process.run(process.java:23) at java.lang.Thread.run(Unknown Source)

Post your mineOre method. (Point out line 63 of the Mining class as well, should be in the mineOre method.)
Something in your server is trying to read the -10th index of an array which is not possible since an array's lowest index is zero.
Bump plx

Oh damn, i fixed this last time for myself, and i dont know it anymore how i did it...
2mins later...
Oh wait i know it! In your case 132 did it end with an "break;"
Cause last time i accidentely deleted it and it causes an dc when clicking objects, so make sure it ends with an break;
Try This:
Code://Starts initial Mine public void mineOre(int rock) { Arrays.sort(rocks); int index = Arrays.binarySearch(rocks, rock); if(index != -1) { if (c.playerLevel[c.playerMining] < miningInfo[index][1]) { c.sM("You don't have high enough level to mine this rock!"); return; } mineOre = miningInfo[index][0]; mineExp = 4*miningInfo[index][2]; beginMine(rock); } }
Nope

Try not to point at a non-existing index on an array..
| « How do i make areas or npc multi, rep++! | NPC DROPS NOT WORKING? [rep] » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |
| Tags for this Thread |