From fd46c039f6fe2ff09f459efa1c8007f9c0132ffb Mon Sep 17 00:00:00 2001 From: SkyNotTheLimit <159592458+ekulxam@users.noreply.github.com> Date: Sun, 17 Mar 2024 16:07:42 -0700 Subject: [PATCH 1/2] Add EfficiencyEnchantmentMixin --- .../mixin/EfficiencyEnchantmentMixin.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/main/java/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java diff --git a/src/main/java/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java b/src/main/java/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java new file mode 100644 index 0000000..71cc49e --- /dev/null +++ b/src/main/java/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java @@ -0,0 +1,19 @@ +package org.ladysnake.impaled.mixin; + +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import ladysnake.impaled.common.item.MaelstromItem; +import net.minecraft.enchantment.EfficiencyEnchantment; +import net.minecraft.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + + +@Mixin(EfficiencyEnchantment.class) +public class EfficiencyEnchantmentMixin { + + @WrapOperation(method = "isAcceptableItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z")) + private boolean maelstromAccept(EfficiencyEnchantment instance, ItemStack stack, Operation original){ + return original.call(instance, stack) || stack.getItem() instanceof MaelstromItem; + } +} From b5d4b58113e24c25def996993ae2d03e579d2fc4 Mon Sep 17 00:00:00 2001 From: SkyNotTheLimit <159592458+ekulxam@users.noreply.github.com> Date: Sun, 17 Mar 2024 16:08:17 -0700 Subject: [PATCH 2/2] Update impaled.mixins.json --- src/main/resources/impaled.mixins.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/impaled.mixins.json b/src/main/resources/impaled.mixins.json index 4b14a62..5142039 100644 --- a/src/main/resources/impaled.mixins.json +++ b/src/main/resources/impaled.mixins.json @@ -9,6 +9,7 @@ "impaling.EntityRendererMixin" ], "mixins": [ + "EfficiencyEnchantmentMixin", "EnchantmentTargetMixin", "EntityMixin", "LivingEntityMixin", @@ -22,4 +23,4 @@ "injectors": { "defaultRequire": 1 } -} \ No newline at end of file +}