Skip to content

Commit

Permalink
Fix anvil cost always being at 5
Browse files Browse the repository at this point in the history
  • Loading branch information
xethlyx authored Jun 19, 2021
1 parent 68cac6b commit 3d0355a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ void onPrepareAnvil(PrepareAnvilEvent event) {

if (first == null || second == null) return;

event.setResult(EnchantUtil.mergeEnchant(first, second, event.getResult()));
ItemStack newResult = EnchantUtil.mergeEnchant(first, second, event.getResult());
event.setResult(newResult);

if (newResult == null) return;
XEnchant.Instance.getServer().getScheduler().runTask(XEnchant.Instance, () -> anvilInventory.setRepairCost(5));
}
}

0 comments on commit 3d0355a

Please sign in to comment.