Skip to content

Commit

Permalink
add modify for item_pre_anvil's item_repair_cost/level_repair_cost
Browse files Browse the repository at this point in the history
  • Loading branch information
Lildirt committed Jul 4, 2024
1 parent ace9b67 commit 7c967e2
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,17 @@ public boolean modifyEvent(String key, Mixed value, BindableEvent event) {
e.setResult(ObjectGenerator.GetGenerator().item(value, t));
return true;
}

MCAnvilInventory anvil = (MCAnvilInventory) e.getInventory();
if(key.equalsIgnoreCase("level_repair_cost")) {
anvil.setRepairCost(ArgumentValidation.getInt32(value, t));
return true;
}

if(key.equalsIgnoreCase("item_repair_cost")) {
anvil.setRepairCostAmount(ArgumentValidation.getInt32(value, t));
return true;
}
}
return false;
}
Expand Down

0 comments on commit 7c967e2

Please sign in to comment.