From a33f326cfcd18b26d0f5339b135c49f7e711038b Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 31 Dec 2019 18:04:03 +0000 Subject: [PATCH] Fix duration parser handling of weeks, months & years (#1905) --- .../java/me/lucko/luckperms/common/util/DurationParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/me/lucko/luckperms/common/util/DurationParser.java b/common/src/main/java/me/lucko/luckperms/common/util/DurationParser.java index a069891ed..4b450e040 100644 --- a/common/src/main/java/me/lucko/luckperms/common/util/DurationParser.java +++ b/common/src/main/java/me/lucko/luckperms/common/util/DurationParser.java @@ -73,7 +73,9 @@ public final class DurationParser { if (matcher.group(g) != null && !matcher.group(g).isEmpty()) { int n = Integer.parseInt(matcher.group(g)); - duration = duration.plus(n, unit); + if (n > 0) { + duration = duration.plus(unit.getDuration().multipliedBy(n)); + } } }