Class AnvilMenuMixin
java.lang.Object
johnsmith.enchantingoverhauled.mixin.menu.ItemCombinerMenuMixin
johnsmith.enchantingoverhauled.mixin.menu.AnvilMenuMixin
- All Implemented Interfaces:
AnvilMenuAccessor
Loader-agnostic part of the anvil overhaul.
This mixin only contains injections whose targets are identical on every loader (mayPickup,
getCost, onTake) plus the hook implementations from AnvilMenuAccessor.
Injections into the vanilla createResult body are declared per loader because NeoForge moves that body
into createResultInternal: see AnvilMenuCreateResultMixin (Fabric/Forge) and
NeoForgeAnvilMenuMixin.
-
Field Summary
Fields inherited from class johnsmith.enchantingoverhauled.mixin.menu.ItemCombinerMenuMixin
inputSlots, player, resultSlots -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.enchantment.ItemEnchantmentsEnchantments of the second input slot, including stored enchantments.intenchanting_overhauled$allowExceededMaxLevel(int original, net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> holder, net.minecraft.world.item.ItemStack workingStack) Preserves overleveled enchantments from either input without allowing further increments.net.minecraft.world.item.enchantment.ItemEnchantmentsenchanting_overhauled$allowTargetEnchantmentLib(net.minecraft.world.item.ItemStack workingStack) Enchantments of the working stack, including stored enchantments.net.minecraft.world.item.ItemStackenchanting_overhauled$applyEnchantRecipeTarget(net.minecraft.world.item.ItemStack itemstack1) Transmutes the working result copy when anEnchantRecipeis active.booleanenchanting_overhauled$canEnchantWorkingStack(net.minecraft.world.item.ItemStack workingStack, Predicate<net.minecraft.world.item.ItemStack> defaultCheck) booleanenchanting_overhauled$canStoreOrTransmuteEnchantments(boolean original, net.minecraft.world.item.ItemStack target) Decides whether the target item may enter the anvil evaluation pipeline (STORED_ENCHANTMENTS holders or a validEnchantRecipe).net.minecraft.world.item.ItemStackenchanting_overhauled$disallowEnchantedBooks(net.minecraft.world.item.ItemStack itemStack) Blocks stored-enchantment sources when anvil enchanting is disabled.Iterator<?> Disables combining enchantments from the second input when anvil enchanting is disabled.voidenchanting_overhauled$getCost(org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable<Integer> cir) voidenchanting_overhauled$mayPickup(net.minecraft.world.entity.player.Player player, boolean present, org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable<Boolean> cir) protected voidenchanting_overhauled$noRepairCostInject(net.minecraft.world.entity.player.Player instance, int levels, com.llamalad7.mixinextras.injector.wrapoperation.Operation<Void> original) voidCancels no-op or cap-violating anvil results right before the menu broadcasts them.booleanenchanting_overhauled$restrictInstabuildArbitraryEnchanting(boolean instabuild, net.minecraft.world.item.ItemStack workingStack) Restricts creative-mode bypass ofcanEnchantto enchantable / stored-enchantment items.voidenchanting_overhauled$setEnchantmentsInCorrectComponent(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.enchantment.ItemEnchantments enchantments, com.llamalad7.mixinextras.injector.wrapoperation.Operation<Void> original) Writes merged enchantments into the correct component (STORED / VOID / default).
-
Constructor Details
-
AnvilMenuMixin
public AnvilMenuMixin()
-
-
Method Details
-
enchanting_overhauled$mayPickup
public void enchanting_overhauled$mayPickup(net.minecraft.world.entity.player.Player player, boolean present, org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable<Boolean> cir) -
enchanting_overhauled$getCost
public void enchanting_overhauled$getCost(org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable<Integer> cir) -
enchanting_overhauled$noRepairCostInject
protected void enchanting_overhauled$noRepairCostInject(net.minecraft.world.entity.player.Player instance, int levels, com.llamalad7.mixinextras.injector.wrapoperation.Operation<Void> original) -
enchanting_overhauled$canStoreOrTransmuteEnchantments
public boolean enchanting_overhauled$canStoreOrTransmuteEnchantments(boolean original, net.minecraft.world.item.ItemStack target) Description copied from interface:AnvilMenuAccessorDecides whether the target item may enter the anvil evaluation pipeline (STORED_ENCHANTMENTS holders or a validEnchantRecipe). Resets and re-resolves the active recipe.- Specified by:
enchanting_overhauled$canStoreOrTransmuteEnchantmentsin interfaceAnvilMenuAccessor
-
enchanting_overhauled$applyEnchantRecipeTarget
public net.minecraft.world.item.ItemStack enchanting_overhauled$applyEnchantRecipeTarget(net.minecraft.world.item.ItemStack itemstack1) Description copied from interface:AnvilMenuAccessorTransmutes the working result copy when anEnchantRecipeis active.- Specified by:
enchanting_overhauled$applyEnchantRecipeTargetin interfaceAnvilMenuAccessor
-
enchanting_overhauled$disallowEnchantedBooks
public net.minecraft.world.item.ItemStack enchanting_overhauled$disallowEnchantedBooks(net.minecraft.world.item.ItemStack itemStack) Description copied from interface:AnvilMenuAccessorBlocks stored-enchantment sources when anvil enchanting is disabled.- Specified by:
enchanting_overhauled$disallowEnchantedBooksin interfaceAnvilMenuAccessor
-
enchanting_overhauled$restrictInstabuildArbitraryEnchanting
public boolean enchanting_overhauled$restrictInstabuildArbitraryEnchanting(boolean instabuild, net.minecraft.world.item.ItemStack workingStack) Description copied from interface:AnvilMenuAccessorRestricts creative-mode bypass ofcanEnchantto enchantable / stored-enchantment items.- Specified by:
enchanting_overhauled$restrictInstabuildArbitraryEnchantingin interfaceAnvilMenuAccessor
-
enchanting_overhauled$allowTargetEnchantmentLib
public net.minecraft.world.item.enchantment.ItemEnchantments enchanting_overhauled$allowTargetEnchantmentLib(net.minecraft.world.item.ItemStack workingStack) Description copied from interface:AnvilMenuAccessorEnchantments of the working stack, including stored enchantments.- Specified by:
enchanting_overhauled$allowTargetEnchantmentLibin interfaceAnvilMenuAccessor
-
enchanting_overhauled$allowEnchantRecipeInput
public net.minecraft.world.item.enchantment.ItemEnchantments enchanting_overhauled$allowEnchantRecipeInput()Description copied from interface:AnvilMenuAccessorEnchantments of the second input slot, including stored enchantments.- Specified by:
enchanting_overhauled$allowEnchantRecipeInputin interfaceAnvilMenuAccessor
-
enchanting_overhauled$allowExceededMaxLevel
public int enchanting_overhauled$allowExceededMaxLevel(int original, net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> holder, net.minecraft.world.item.ItemStack workingStack) Description copied from interface:AnvilMenuAccessorPreserves overleveled enchantments from either input without allowing further increments.- Specified by:
enchanting_overhauled$allowExceededMaxLevelin interfaceAnvilMenuAccessor
-
enchanting_overhauled$setEnchantmentsInCorrectComponent
public void enchanting_overhauled$setEnchantmentsInCorrectComponent(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.enchantment.ItemEnchantments enchantments, com.llamalad7.mixinextras.injector.wrapoperation.Operation<Void> original) Description copied from interface:AnvilMenuAccessorWrites merged enchantments into the correct component (STORED / VOID / default).- Specified by:
enchanting_overhauled$setEnchantmentsInCorrectComponentin interfaceAnvilMenuAccessor
-
enchanting_overhauled$preventRedundantEnchanting
public void enchanting_overhauled$preventRedundantEnchanting()Description copied from interface:AnvilMenuAccessorCancels no-op or cap-violating anvil results right before the menu broadcasts them.- Specified by:
enchanting_overhauled$preventRedundantEnchantingin interfaceAnvilMenuAccessor
-
enchanting_overhauled$disallowEnchantmentCombination
Description copied from interface:AnvilMenuAccessorDisables combining enchantments from the second input when anvil enchanting is disabled.- Specified by:
enchanting_overhauled$disallowEnchantmentCombinationin interfaceAnvilMenuAccessor
-
enchanting_overhauled$canEnchantWorkingStack
public boolean enchanting_overhauled$canEnchantWorkingStack(net.minecraft.world.item.ItemStack workingStack, Predicate<net.minecraft.world.item.ItemStack> defaultCheck) - Specified by:
enchanting_overhauled$canEnchantWorkingStackin interfaceAnvilMenuAccessor
-