diff --git a/src/main/java/com/direwolf20/justdirethings/common/items/interfaces/ToggleableTool.java b/src/main/java/com/direwolf20/justdirethings/common/items/interfaces/ToggleableTool.java index bc3e21f4..1c27ca13 100644 --- a/src/main/java/com/direwolf20/justdirethings/common/items/interfaces/ToggleableTool.java +++ b/src/main/java/com/direwolf20/justdirethings/common/items/interfaces/ToggleableTool.java @@ -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); + } } } }