From 20fd2dc63a7547c341062a20e26b1154a48952c1 Mon Sep 17 00:00:00 2001 From: DoKM Date: Fri, 20 Aug 2021 14:53:17 +0200 Subject: Add option to disable pickaxe ability cooldown as pickaxe durability --- .../moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java | 4 ++-- .../notenoughupdates/options/seperateSections/ItemOverlays.java | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java index 59b3d802..053910bc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java @@ -124,7 +124,7 @@ public class ItemCooldowns { } private static void updatePickaxeCooldown() { - if(pickaxeCooldown == -1) { + if(pickaxeCooldown == -1 && NotEnoughUpdates.INSTANCE.config.itemOverlays.pickaxeAbility) { for(ItemStack stack : Minecraft.getMinecraft().thePlayer.inventory.mainInventory) { if(stack != null && stack.hasTagCompound()) { String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); @@ -148,7 +148,7 @@ public class ItemCooldowns { @SubscribeEvent public void onChatMessage(ClientChatReceivedEvent event) { - if(pickaxeCooldown != 0 && PICKAXE_ABILITY_REGEX.matcher(event.message.getFormattedText()).matches()) { + if(pickaxeCooldown != 0 && PICKAXE_ABILITY_REGEX.matcher(event.message.getFormattedText()).matches() && NotEnoughUpdates.INSTANCE.config.itemOverlays.pickaxeAbility) { updatePickaxeCooldown(); pickaxeUseCooldownMillisRemaining = pickaxeCooldown*1000; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java index af236bf8..86256650 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java @@ -303,4 +303,13 @@ public class ItemOverlays { @ConfigEditorBoolean public boolean enablePrismapumpOverlay = true; + + @Expose + @ConfigOption( + name = "Pickaxe Ability Cooldown", + desc = "Show the cooldown duration off the pickaxe ability as the durability." + ) + @ConfigEditorBoolean + public boolean pickaxeAbility = true; + } -- cgit