I am remaking skills on this new base I have, and I have come to this weird error when I got to cooking. Note: I used enums to do this.
Code:
local variable NAME is accessed from within inner class; needs to be declared final
I know the solution is NOT to just name everything final...especially since many of them need to be changed.
I have this code which I suspect is causing the problem--removing it resolves errors.
Code:
World.getWorld().submit(new Events(1200) {
public void execute() {
c.getItems().deleteItem(rawId, c.getItems().getItemSlot(rawId), 1);
double randNum = cookingRandom.nextDouble() * 100.0;
if(burnChance(c, rawId, object) <= randNum) {
c.sendMessage("You successfully cook the " +
c.getItems().getItemName(rawId).toLowerCase() + ".");
c.getPA().addSkillXP(COOKING_XP * r.getXp(), 7);
c.getItems().addItem(r.getCookedId(), 1);
} else {
c.sendMessage("Oops! You accidentally burn the " +
c.getItems().getItemName(r.getBurntId()).toLowerCase() + "!");
c.getItems().addItem(r.getBurntId(), 1);
}
amount -= 1;
if(!c.getItems().playerHasItem(r.getRawId()) || amount <= 0) {
resetCooking(c);
this.stop();
}
if(!c.stopPlayerSkill) {
resetCooking(c);
this.stop();
}
}
});
World.getWorld().submit(new Events(2400) {
public void execute() {
if (object > 0) {
c.startAnimation(object == 2732 ? 897 : 896);
}
if (!c.stopPlayerSkill) {
this.stop();
}
}
});
And also this is what was here.
I have no errors after removing these two bits of code. I really need help.
If you need it, I can post more code if it is needed.