forked from Upstream/mmocore
hopefully fixed an issue with fish drop tables
This commit is contained in:
parent
6e2ff1ea53
commit
7e8a074669
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user