diff options
Diffstat (limited to 'src/main/java/dulkirmod/mixins/MixinItem.java')
-rw-r--r-- | src/main/java/dulkirmod/mixins/MixinItem.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/dulkirmod/mixins/MixinItem.java b/src/main/java/dulkirmod/mixins/MixinItem.java new file mode 100644 index 0000000..d3cb421 --- /dev/null +++ b/src/main/java/dulkirmod/mixins/MixinItem.java @@ -0,0 +1,19 @@ +package dulkirmod.mixins; + +import dulkirmod.DulkirMod; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(value = {Item.class}) +public class MixinItem { + + @Inject(method = "shouldCauseReequipAnimation", at = @At("HEAD"), cancellable = true, remap = false) + public void overrideReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged, CallbackInfoReturnable<Boolean> ci) { + if (DulkirMod.Companion.getConfig().getCancelReequip()) + ci.setReturnValue(false); + } +} |