mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
Add failsafes to repairables
This commit is contained in:
parent
06bf814fcf
commit
945359b408
@ -29,9 +29,9 @@ public class Repairable {
|
||||
public Repairable(String itemMaterial, List<String> repairMaterials, int minimumQuantity, int minimumLevel, double xpMultiplier) {
|
||||
this.itemMaterial = Material.matchMaterial(itemMaterial);
|
||||
this.repairMaterials = ItemUtils.matchMaterials(repairMaterials);
|
||||
this.minimumQuantity = minimumQuantity;
|
||||
this.minimumLevel = minimumLevel;
|
||||
this.xpMultiplier = xpMultiplier;
|
||||
this.minimumQuantity = Math.max(1, minimumQuantity);
|
||||
this.minimumLevel = Math.max(0, minimumLevel);
|
||||
this.xpMultiplier = Math.max(0, xpMultiplier);
|
||||
|
||||
this.maximumDurability = this.itemMaterial.getMaxDurability();
|
||||
this.baseRepairDurability = (short) (maximumDurability / minimumQuantity);
|
||||
|
Loading…
Reference in New Issue
Block a user