Skip to content

Commit

Permalink
anvil config setting only applies when enchanting items, not combinin…
Browse files Browse the repository at this point in the history
…g books
  • Loading branch information
DaFuqs committed Nov 13, 2023
1 parent 1234ebe commit 381f098
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ public void updateResult() {
if (!repairSlotStack.isEmpty()) {
combined = true;

boolean enchantedBookInInputSlot = inputStack.isOf(Items.ENCHANTED_BOOK) && !EnchantedBookItem.getEnchantmentNbt(inputStack).isEmpty();
boolean enchantedBookInRepairSlot = repairSlotStack.isOf(Items.ENCHANTED_BOOK) && !EnchantedBookItem.getEnchantmentNbt(repairSlotStack).isEmpty();

int o;
int repairItemCount;
int newOutputStackDamage;
Expand Down Expand Up @@ -276,7 +278,8 @@ public void updateResult() {
bl3 = true;
} else {
bl2 = true;
if (!SpectrumCommon.CONFIG.BedrockAnvilCanExceedMaxVanillaEnchantmentLevel && newEnchantmentLevel > enchantment.getMaxLevel()) {
boolean capToMaxLevel = enchantedBookInInputSlot || !SpectrumCommon.CONFIG.BedrockAnvilCanExceedMaxVanillaEnchantmentLevel;
if (capToMaxLevel && newEnchantmentLevel > enchantment.getMaxLevel()) {
newEnchantmentLevel = enchantment.getMaxLevel();
}

Expand Down

0 comments on commit 381f098

Please sign in to comment.