Код: Выделить всё
public void updateResult() {
ItemStack itemStack = this.input.getStack(0);
int i = 0;
int j = 0;
int k = 0;
/***/
for (m = 0; l > 0 && m < itemStack3.getCount(); m++) {
int n = itemStack2.getDamage() - l;
itemStack2.setDamage(n);
i++;
l = Math.min(itemStack2.getDamage(), itemStack2.getMaxDamage() / 4);
}
/***/
Я пробовал следующее, но понятия не имею:
Код: Выделить всё
@Inject(method = "updateResult", at = @At(value = "INVOKE", target =
"Lnet/minecraft/item/ItemStack;setDamage(I)V", shift = At.Shift.BY, by = 2))
private void resetRepair(CallbackInfo ci, @Local(ordinal = 1) ItemStack itemStack2,
@Local(ordinal = 0) LocalRef i) {
if (itemStack2.getItem() instanceof MyInterface) i.set(0);
}
@Local не соответствует ни одному или не соответствует несколько локальных переменных в целевом методе
Или попробовал это, но не знаю цель:
Код: Выделить всё
@Redirect(method = "updateResult", at = @At(value = "INVOKE", target = "WHAT IS THE TARGET OF i++"))Код: Выделить всё
@ModifyConstant(method = "updateResult", constant = @Constant(intValue = 1))Код: Выделить всё
@ModifyVariable(method = "updateResult", at = @At("STORE"))Подробнее здесь: https://stackoverflow.com/questions/793 ... i-in-mixin
Мобильная версия