Okay, first let me show you the code, This is Initilised at the top of the class,
Code:
private int fireCount = 0;
This is the lightFire method, At this point i know that it is not going to walk one place X or Y, thats fine. & I know that it wont create ashes which is fine also, Im executing this method, and it seems to be never ending. And the fire is NOT De-spawning.
My Idea for why the fire dosent despawn: GetX & GetY are updating to the players position and not where the fire was created.
Any Ideas on this?
Code:
public void lightFire(int slot) {
if (c.duelStatus >= 5) {
c.sendMessage("Why am I trying to light a fire in the duel arena?");
return;
}
if (c.playerLevel[c.playerFiremaking] >= level[slot]) {
if (c.getItems().playerHasItem(590) && c.getItems().playerHasItem(logs[slot])) {
if (System.currentTimeMillis() - lastLight > DELAY) {
c.startAnimation(733,0);
final int PosX = c.getX();
final int posY = c.getY();
c.getItems().deleteItem(logs[slot], c.getItems().getItemSlot(logs[slot]), 1);
c.getPA().addSkillXP(logs[slot] * Config.FIREMAKING_EXPERIENCE, c.playerFiremaking);
CycleEventHandler.getSingleton().addEvent(1337, c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
if (fireCount == 0) {
c.getPA().checkObjectSpawn(2732, PosX, posY, 1, 10);
fireCount = 0;
System.out.println("Constructing fire");
}
if (fireCount == 15) {
container.stop();
}
if (fireCount != 15 && fireCount != 0) {
fireCount++;
}
}
@Override
public void stop() {
c.getPA().checkObjectSpawn(-1, PosX, posY, 1, 10);
System.out.println("Destructing fire");
}
}, 1);
c.sendMessage("You light the fire.");
this.lastLight = System.currentTimeMillis();
resetAnim = true;
}
}
}
}