Skip to content

Commit

Permalink
Merge pull request #219 from zperk13/main
Browse files Browse the repository at this point in the history
Added cycle setting information to action bar
  • Loading branch information
Direwolf20-MC authored Oct 19, 2024
2 parents d695f8e + a5fe63c commit c6c1458
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,20 @@ default boolean useAbility(Level level, Player player, ItemStack itemStack, int
if (!level.isClientSide) {
for (Ability ability : getAllPassiveAbilities()) {
if (customBindAbilities.contains(ability)) {
if (ability.settingType == Ability.SettingType.CYCLE)
ToggleableTool.cycleSetting(itemStack, ability.getName());
else
if (ability.settingType == Ability.SettingType.CYCLE) {
String abilityName = ability.getName();
ToggleableTool.cycleSetting(itemStack, abilityName);
boolean is_enabled = ToggleableTool.getSetting(itemStack, abilityName);
if (is_enabled) {
int currentValue = getToolValue(itemStack, abilityName);
player.displayClientMessage(Component.translatable("justdirethings.ability", Component.translatable(ability.getLocalization() + "_" + currentValue), Component.translatable("justdirethings.enabled")), true);
} else {
player.displayClientMessage(Component.translatable("justdirethings.ability", Component.translatable(ability.getLocalization()), Component.translatable("justdirethings.disabled")), true);
}
} else {
ToggleableTool.toggleSetting(itemStack, ability.getName());
player.displayClientMessage(Component.translatable("justdirethings.ability", Component.translatable(ability.getLocalization()), ToggleableTool.getSetting(itemStack, ability.getName()) ? Component.translatable("justdirethings.enabled") : Component.translatable("justdirethings.disabled")), true);
player.displayClientMessage(Component.translatable("justdirethings.ability", Component.translatable(ability.getLocalization()), ToggleableTool.getSetting(itemStack, ability.getName()) ? Component.translatable("justdirethings.enabled") : Component.translatable("justdirethings.disabled")), true);
}
}
}
}
Expand Down

0 comments on commit c6c1458

Please sign in to comment.