Using the @ModifyExpressionValue annotation, I made 2 expressions automatically evaluate to true no matter what. This isn't a permanent solution just trying to get something working and go from there. Here are the two methods:
@ModifyExpressionValue(method = "updateResult", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isOf(Lnet/minecraft/item/Item;)Z"))
private boolean allowHorseArmorCombine(boolean original) {
boolean custom = this.input.getStack(0).isIn(ModTags.Items.HORSE_ARMOR) && this.input.getStack(1).isIn(ModTags.Items.HORSE_ARMOR);
return true;
}
@ModifyExpressionValue(method = "updateResult", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isDamageable()Z"))
private boolean allowNonDamageableCombine(boolean original) {
return true;
}```
This is the condition from the `AnvilScreenHandler` class:
```java
!bl && (!itemStack2.isOf(itemStack3.getItem()) || !itemStack2.isDamageable())```
Despite forcing `isOf` and `isDamageable` to be true, the condition still overall evaluates to true. Why does this happen? Also, does the `ModifyExpressionValue` work on all invokes to the target method in the injected method?
-# Ping on reply please :) 🔔