Hey guys, im writing mining for runesource and im having a little trouble with the event system.
I have the method below for handling the the mining process, but when ever it is called from mining.java it gives me this null pointer in the terminal
Code:
java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(Unknown Source)
at java.util.LinkedList$ListItr.remove(Unknown Source)
at com.rs2.model.World.process(World.java:43)
at com.rs2.Server.cycle(Server.java:200)
at com.rs2.Server.run(Server.java:113)
at java.lang.Thread.run(Unknown Source)
When i run a similar event in commands.java, no nulls occur (has nothing to do with tick.java). Btw, the items still are added when the null occurs.
This is the method that is called
Code:
public static void checkBeforeMine(final Player player, final int objectClickId){
int oreObjectIdIndex = Arrays.binarySearch(oreObjectId, objectClickId);
final int ObjectId = oreObjectId[oreObjectIdIndex];
final int oreItemId = ores[oreObjectIdIndex][0];
final int expGained = ores[oreObjectIdIndex][2];
final int levelRequired = ores[oreObjectIdIndex][1];
player.getUpdateFlags().sendAnimation(624, 0);
player.getActionSender().sendMessage("You swing your pick axe at the rock...");
World.submit(new Tick(4) {
@Override
public void execute() {
player.getInventory().addItem(new Item(oreItemId));
player.getActionSender().sendMessage("You managed to mine some copper ore.");
this.stop();
}
});
}
If anyone can solve the problem i would be thankful, its been bugging me and i cant seem to understand why it is doing this.