Line 149 in RepairContainer.java (in 1.15.2, I don't know about 1.16) checks whether the middle slot in the anvil GUI is empty, and only if it isn't the onAnvilChange ForgeHook is called, which makes is making it pretty impossible for me to implement anvil recipes that don't need an item in the center. I've had to resort to making a coremod to implement this, but I don't think it should be that way.
The relevant lines look like this:
if (!itemstack2.isEmpty()) {
if (!ForgeHooks.onAnvilChange(this, itemstack, itemstack2, this.outputSlot, this.repairedItemName, j)) {
return;
}
I don't think much of anything would break if the ForgeHook was to be moved in front of the first line to allow events to be sent with empty center slots.
If you're wondering why I would want to do what I'm doing, it's a flavor thing for the mod I'm working on and also lets me make it cost XP to get the output item, to keep it out of the early game.