aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-07-17 03:27:35 -0500
committeringlettronald <inglettronald@gmail.com>2023-07-17 03:27:35 -0500
commitd21dad73e37c1aaba1933a52b094534865594dc7 (patch)
tree33e825fe82ea3435a2c49c2ff8063e2f5d75752d /src/main/java
parent1a8e45d8519a8ae69e14db8ea103a7fdf7b80923 (diff)
downloadDulkirMod-Fabric-d21dad73e37c1aaba1933a52b094534865594dc7.tar.gz
DulkirMod-Fabric-d21dad73e37c1aaba1933a52b094534865594dc7.tar.bz2
DulkirMod-Fabric-d21dad73e37c1aaba1933a52b094534865594dc7.zip
finished infrastructure for Durability-based cooldown displays that use sounds
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/dulkirfabric/mixin/ItemMixin.java7
1 files changed, 5 insertions, 2 deletions
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<Boolean> 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<Integer> cir) {
- CooldownDisplays.INSTANCE.calcDurability(stack, cir);
+ if (DulkirConfig.ConfigVars.getConfigOptions().getDuraCooldown())
+ CooldownDisplays.INSTANCE.calcDurability(stack, cir);
}
}