Capitalized consts

This commit is contained in:
Bishop 2026-08-01 10:22:11 -05:00
parent 938f068211
commit feda8c6988

View file

@ -128,12 +128,12 @@ public final class WeaponInterface extends Component {
/**
* Attribute storing the player's autocast spell for reload upon relog.
*/
public static final String attributeAutocastButtonId = "/save:autocast:buttonid";
public static final String ATTRIBUTE_AUTOCAST_BUTTON_ID = "/save:autocast:buttonid";
/**
* Attribute storing the player's autocast combat style for reload upon relog.
*/
public static final String attributeAutocastStyle = "/save:autocast:style";
public static final String ATTRIBUTE_AUTOCAST_STYLE = "/save:autocast:style";
/**
* The player.
@ -309,7 +309,7 @@ public final class WeaponInterface extends Component {
}
}
if (current == WeaponInterfaces.STAFF && slot <= 2) {
removeAttributes(player, attributeAutocastButtonId, attributeAutocastStyle);
removeAttributes(player, ATTRIBUTE_AUTOCAST_BUTTON_ID, ATTRIBUTE_AUTOCAST_STYLE);
}
if (slot < 0 || slot >= current.getAttackStyles().length) {
return false;
@ -392,7 +392,7 @@ public final class WeaponInterface extends Component {
}
}
if (forgetAutocast) {
removeAttributes(player, attributeAutocastButtonId, attributeAutocastStyle);
removeAttributes(player, ATTRIBUTE_AUTOCAST_BUTTON_ID, ATTRIBUTE_AUTOCAST_STYLE);
}
if (buttonId < 0) {
player.getProperties().setAutocastSpell(null);
@ -409,8 +409,8 @@ public final class WeaponInterface extends Component {
setComponentVisibility(player, Components.WEAPON_STAFF_SEL_90, stdAutocastBookChild, !defensive);
current = (CombatSpell) (modern ? SpellBookManager.SpellBook.MODERN.getSpell(data[buttonId]) : SpellBookManager.SpellBook.ANCIENT.getSpell(data[buttonId]));
player.getProperties().setAutocastSpell(current);
setAttribute(player, attributeAutocastButtonId, buttonId);
setAttribute(player, attributeAutocastStyle, player.getSettings().getAttackStyleIndex());
setAttribute(player, ATTRIBUTE_AUTOCAST_BUTTON_ID, buttonId);
setAttribute(player, ATTRIBUTE_AUTOCAST_STYLE, player.getSettings().getAttackStyleIndex());
int configId = configStart + (2 * buttonId);
if (modern && player.getEquipment().getNew(3).getName().equalsIgnoreCase("Slayer's staff") || modern && player.getEquipment().getNew(3).getName().equalsIgnoreCase("Void knight mace")) {
boolean slayer = player.getEquipment().getNew(3).getName().equalsIgnoreCase("Slayer's staff");
@ -535,10 +535,10 @@ public final class WeaponInterface extends Component {
* Returns false if the player has no autocast to restore, true otherwise.
*/
public boolean restoreAutocast() {
int buttonID = getAttribute(player, attributeAutocastButtonId, -1);
int style = getAttribute(player, attributeAutocastStyle, -1);
int buttonID = getAttribute(player, ATTRIBUTE_AUTOCAST_BUTTON_ID, -1);
int style = getAttribute(player, ATTRIBUTE_AUTOCAST_STYLE, -1);
if (buttonID < 0 || style < 0 || !canAutocast(false)) {
removeAttributes(player, attributeAutocastButtonId, attributeAutocastStyle);
removeAttributes(player, ATTRIBUTE_AUTOCAST_BUTTON_ID, ATTRIBUTE_AUTOCAST_STYLE);
return false;
}
restoreAttackStyle(style);