hopefully fixed an issue with fish drop tables

This commit is contained in:
Jules 2022-01-27 21:38:32 +01:00
parent 6e2ff1ea53
commit 7e8a074669
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,7 @@
package net.Indyuce.mmocore.api.util.math.formula;
import org.apache.commons.lang.Validate;
import java.util.Random;
public class RandomAmount {
@ -10,6 +12,7 @@ public class RandomAmount {
public RandomAmount(double min, double max) {
this.min = min;
this.max = max;
Validate.isTrue(max >= min, "Max value must be greater than min");
}
public RandomAmount(String value) {

View File

@ -14,7 +14,7 @@ public abstract class DropItem {
public DropItem(MMOLineConfig config) {
chance = config.args().length > 0 ? Double.parseDouble(config.args()[0]) : 1;
amount = config.args().length > 1 ? new RandomAmount(config.args()[1]) : new RandomAmount(1, 0);
amount = config.args().length > 1 ? new RandomAmount(config.args()[1]) : new RandomAmount(1, 1);
weight = config.args().length > 2 ? Double.parseDouble(config.args()[2]) : 0;
}