Skip to content

Commit

Permalink
ban command: accept duration=0 as infinite
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 15, 2022
1 parent da55b71 commit 6cb38c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -812,7 +812,8 @@ public static void register() {
// @attribute <CuboidTag.intersection[<cuboid>]>
// @returns CuboidTag
// @description
// Returns the intersection of two intersecting cuboids. Returns null if the cuboids do not intersect.
// Returns the intersection of two intersecting cuboids - in other words, returns a cuboid of just the overlap between the two cuboids.
// Returns null if the cuboids do not intersect.
// @example
// # Notes the intersection as "intersecting_area".
// - note <cuboid[my_cuboid].intersection[my_second_cuboid]> as:intersecting_area
Expand Down
Expand Up @@ -111,7 +111,10 @@ else if (!scriptEntry.hasObject("duration")
scriptEntry.addObject("expire", arg.asType(TimeTag.class));
}
else {
scriptEntry.addObject("expire", new TimeTag(TimeTag.now().millis() + arg.asType(DurationTag.class).getMillis()));
long duration = arg.asType(DurationTag.class).getMillis();
if (duration > 0) { // Explicitly consider infinite duration as null input
scriptEntry.addObject("expire", new TimeTag(TimeTag.now().millis() + duration));
}
}
}
else if (!scriptEntry.hasObject("source")
Expand Down

0 comments on commit 6cb38c6

Please sign in to comment.