From d21dad73e37c1aaba1933a52b094534865594dc7 Mon Sep 17 00:00:00 2001 From: inglettronald Date: Mon, 17 Jul 2023 03:27:35 -0500 Subject: finished infrastructure for Durability-based cooldown displays that use sounds --- src/main/java/com/dulkirfabric/mixin/ItemMixin.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/dulkirfabric/mixin/ItemMixin.java b/src/main/java/com/dulkirfabric/mixin/ItemMixin.java index 53e637e..13e1456 100644 --- a/src/main/java/com/dulkirfabric/mixin/ItemMixin.java +++ b/src/main/java/com/dulkirfabric/mixin/ItemMixin.java @@ -1,5 +1,6 @@ package com.dulkirfabric.mixin; +import com.dulkirfabric.config.DulkirConfig; import com.dulkirfabric.features.CooldownDisplays; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -14,11 +15,13 @@ public class ItemMixin { @Inject(method = "isItemBarVisible(Lnet/minecraft/item/ItemStack;)Z", at = @At("HEAD"), cancellable = true) public void shouldDisplayDurabilityBar(ItemStack stack, CallbackInfoReturnable cir) { - CooldownDisplays.INSTANCE.shouldDisplay(stack, cir); + if (DulkirConfig.ConfigVars.getConfigOptions().getDuraCooldown()) + CooldownDisplays.INSTANCE.shouldDisplay(stack, cir); } @Inject(method = "getItemBarStep(Lnet/minecraft/item/ItemStack;)I", at = @At("HEAD"), cancellable = true) public void calculateItemHealth(ItemStack stack, CallbackInfoReturnable cir) { - CooldownDisplays.INSTANCE.calcDurability(stack, cir); + if (DulkirConfig.ConfigVars.getConfigOptions().getDuraCooldown()) + CooldownDisplays.INSTANCE.calcDurability(stack, cir); } } -- cgit