From 06bf814fcf99c89d11c05100d2d6553c8c91e180 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 10 May 2019 12:16:26 -0700 Subject: [PATCH] Add failsafes to Salvageables --- .../nossr50/skills/salvage/salvageables/Salvageable.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java b/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java index 495b4a916..3d98084f4 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java @@ -30,11 +30,11 @@ public class Salvageable { this.salvagedItemMaterial = salvagedItemMaterial; this.salvageItemType = ItemUtils.determineItemType(itemMaterial); this.salvageItemMaterialCategory = ItemUtils.determineMaterialType(salvagedItemMaterial); - this.minimumLevel = minimumLevel; - this.maximumQuantity = maximumQuantity; + this.minimumLevel = Math.max(0, minimumLevel); + this.maximumQuantity = Math.max(1, maximumQuantity); this.maximumDurability = itemMaterial.getMaxDurability(); this.baseSalvageDurability = (short) (maximumDurability / maximumQuantity); - this.xpMultiplier = 1.0D; + this.xpMultiplier = Math.max(0, 1.0D); } public Material getItemMaterial() {