Of course, this is for the magic sidebar:
Code:
public void switchSpellBook() {
if (c.playerMagicBook < 2)
c.playerMagicBook++;
else
c.playerMagicBook = 0;
c.sendMessage("You switch to " + spellBooks[c.playerMagicBook] + " magics.");
c.setSidebarInterface(6, spellBook[c.playerMagicBook]);
c.getItems().sendWeapon(c.playerEquipment[c.playerWeapon], c.getItems().getItemName(c.playerEquipment[c.playerWeapon]));
c.autocastId = -1;
c.getPA().resetAutocast();
}
Although you wouldn't really need an "if" statement unless you're switching between different interfaces.