From 1c9b0769b8aac81b01745c90fbf08beb6f3e9c56 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Thu, 27 Aug 2020 12:52:24 +0200 Subject: [PATCH] Fixed fishing drop tables error messages --- .../mmocore/api/droptable/dropitem/fishing/FishingDropItem.java | 2 ++ .../net/Indyuce/mmocore/manager/profession/FishingManager.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/Indyuce/mmocore/api/droptable/dropitem/fishing/FishingDropItem.java b/src/main/java/net/Indyuce/mmocore/api/droptable/dropitem/fishing/FishingDropItem.java index 55adfad2..a1c52840 100644 --- a/src/main/java/net/Indyuce/mmocore/api/droptable/dropitem/fishing/FishingDropItem.java +++ b/src/main/java/net/Indyuce/mmocore/api/droptable/dropitem/fishing/FishingDropItem.java @@ -1,5 +1,6 @@ package net.Indyuce.mmocore.api.droptable.dropitem.fishing; +import org.apache.commons.lang.Validate; import org.bukkit.inventory.ItemStack; import net.Indyuce.mmocore.MMOCore; @@ -23,6 +24,7 @@ public class FishingDropItem { experience = new RandomAmount(config.getString("experience")); weight = config.getInt("weight", 1); + Validate.isTrue(weight > 0, "A fishing drop table item cannot have 0 weight"); dropItem = MMOCore.plugin.loadManager.loadDropItem(config); } diff --git a/src/main/java/net/Indyuce/mmocore/manager/profession/FishingManager.java b/src/main/java/net/Indyuce/mmocore/manager/profession/FishingManager.java index 3be01f21..ef16cfbe 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/profession/FishingManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/profession/FishingManager.java @@ -80,7 +80,7 @@ public class FishingManager extends MMOManager { "Could not load item '" + str + "' from fishing drop table '" + id + "': " + exception.getMessage()); } - Validate.notEmpty(list, "The item list must not be empty."); + Validate.notEmpty(items, "The item list must not be empty."); } public boolean areConditionsMet(ConditionInstance entity) {