Skip to content

Commit 01b8744

Browse files
committed
Minor improvement to WorldBorderBoundsChangeEvent
1 parent 638a72c commit 01b8744

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

paper-api/src/main/java/io/papermc/paper/event/world/border/WorldBorderBoundsChangeEvent.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.bukkit.event.Cancellable;
77
import org.bukkit.event.HandlerList;
88
import org.jetbrains.annotations.ApiStatus;
9+
import org.jetbrains.annotations.Range;
910
import org.jspecify.annotations.NullMarked;
1011
import java.time.Duration;
1112

@@ -94,9 +95,9 @@ public long getDuration() {
9495
*
9596
* @param duration the time in ticks for the change
9697
*/
97-
public void setDurationTicks(final long duration) {
98+
public void setDurationTicks(@Range(from = 0, to = Integer.MAX_VALUE) final long duration) {
9899
this.duration = Math.clamp(duration, 0L, Integer.MAX_VALUE);
99-
if (duration >= 0 && this.type == Type.INSTANT_MOVE) {
100+
if (this.type == Type.INSTANT_MOVE) {
100101
this.type = Type.STARTED_MOVE;
101102
}
102103
}

0 commit comments

Comments
 (0)