Interface Cooldown<C>
- Type Parameters:
C- command sender type
- All Superinterfaces:
Command.Builder.Applicable<C>
- All Known Implementing Classes:
ImmutableCooldown
@Immutable
@API(status=STABLE,
since="1.0.0")
public interface Cooldown<C>
extends Command.Builder.Applicable<C>
An instance of a cooldown for a
CooldownGroup belonging to a command sender.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull Command.Builder<C>applyToCommandBuilder(@NonNull Command.Builder<C> builder) static <C> @NonNull ImmutableCooldown.DurationBuildStage<C>builder()Returns a new cooldown builder.duration()Returns the cooldown duration.default @Nullable CooldownGroupgroup()Returns the group that this instance belongs to.of(@NonNull DurationFunction<C> duration) Returns a new cooldown with the givendurationusingCooldownConfiguration.fallbackGroup()as the group.of(@NonNull DurationFunction<C> duration, @NonNull CooldownGroup group) Returns a new cooldown with the givendurationandgroup.
-
Method Details
-
of
Returns a new cooldown with the givendurationusingCooldownConfiguration.fallbackGroup()as the group.- Type Parameters:
C- command sender type- Parameters:
duration- the duration- Returns:
- the cooldown
-
of
static <C> @NonNull Cooldown<C> of(@NonNull DurationFunction<C> duration, @NonNull CooldownGroup group) Returns a new cooldown with the givendurationandgroup.- Type Parameters:
C- command sender type- Parameters:
duration- the durationgroup- cooldown group- Returns:
- the cooldown
-
builder
Returns a new cooldown builder.- Type Parameters:
C- command sender type- Returns:
- the builder
-
duration
@NonNull DurationFunction<C> duration()Returns the cooldown duration.- Returns:
- the duration
-
group
Returns the group that this instance belongs to. If set tonullthenCooldownConfiguration.fallbackGroup()will be used.- Returns:
- the cooldown group
-
applyToCommandBuilder
- Specified by:
applyToCommandBuilderin interfaceCommand.Builder.Applicable<C>
-