18 lines
728 B
Java
18 lines
728 B
Java
package io.gitlab.jfronny.yescheat.mixin;
|
|
|
|
import net.minecraft.enchantment.Enchantment;
|
|
import net.minecraft.enchantment.InfinityEnchantment;
|
|
import net.minecraft.enchantment.MendingEnchantment;
|
|
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(InfinityEnchantment.class)
|
|
public class UnlockMendingInfinity {
|
|
@Inject(method = "canAccept", at = @At("HEAD"), cancellable = true)
|
|
private void differs(Enchantment other, CallbackInfoReturnable<Boolean> cir) {
|
|
if (other instanceof MendingEnchantment) cir.setReturnValue(true);
|
|
}
|
|
}
|