From 50bc3d5177ac2b7e162f8e3f619095d6e92e2e9a Mon Sep 17 00:00:00 2001 From: SkyNotTheLimit <159592458+ekulxam@users.noreply.github.com> Date: Sun, 17 Mar 2024 16:06:46 -0700 Subject: [PATCH 1/4] Create EfficiencyEnchantmentMixin.java --- .../mixin/EfficiencyEnchantmentMixin.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java diff --git a/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java b/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java new file mode 100644 index 0000000..968eb40 --- /dev/null +++ b/src/main/java/org/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 EfficiencyMixin { + + @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 d60901388b90f48f6c224fe1929c3a0dd59f334a Mon Sep 17 00:00:00 2001 From: SkyNotTheLimit <159592458+ekulxam@users.noreply.github.com> Date: Sun, 17 Mar 2024 16:07:06 -0700 Subject: [PATCH 2/4] Update EfficiencyEnchantmentMixin.java --- .../org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java b/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java index 968eb40..71cc49e 100644 --- a/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java +++ b/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java @@ -10,7 +10,7 @@ @Mixin(EfficiencyEnchantment.class) -public class EfficiencyMixin { +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){ From 9c6b6769ce3cb885885496ca6c32d6fa4d147332 Mon Sep 17 00:00:00 2001 From: SkyNotTheLimit <159592458+ekulxam@users.noreply.github.com> Date: Sun, 17 Mar 2024 16:08:29 -0700 Subject: [PATCH 3/4] 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 a39322e..e81a6a4 100644 --- a/src/main/resources/impaled.mixins.json +++ b/src/main/resources/impaled.mixins.json @@ -10,6 +10,7 @@ ], "mixins": [ "DamageSourcesMixin", + "EfficiencyEnchantmentMixin", "EnchantmentTargetMixin", "EntityMixin", "LivingEntityMixin", @@ -23,4 +24,4 @@ "injectors": { "defaultRequire": 1 } -} \ No newline at end of file +} From 3e4ffe8bf265699090401cce988709f3b952b5b4 Mon Sep 17 00:00:00 2001 From: SkyNotTheLimit <159592458+ekulxam@users.noreply.github.com> Date: Sun, 17 Mar 2024 16:15:31 -0700 Subject: [PATCH 4/4] Fix imports whoops --- .../org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java b/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java index 71cc49e..41a55a4 100644 --- a/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java +++ b/src/main/java/org/ladysnake/impaled/mixin/EfficiencyEnchantmentMixin.java @@ -2,7 +2,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import ladysnake.impaled.common.item.MaelstromItem; +import org.ladysnake.impaled.common.item.MaelstromItem; import net.minecraft.enchantment.EfficiencyEnchantment; import net.minecraft.item.ItemStack; import org.spongepowered.asm.mixin.Mixin;