Interface NecrifyTemplate

All Known Implementing Classes:
MinecraftTemplate

public interface NecrifyTemplate
A template is a set of stages that are used to unify punishments so that for every same reason of punishing the same punishment is issued with the option to stage this. For example, if some player is cheating, they can be banned at the first occasion for 30 days and after that permanently if they chose to cheat yet again.

It is also possible to set up different types of punishments for the same template, so as for example one could be muted for using inappropriate language and then banned for the same reason in the next stage.

Stages are uniquely identified by their name.

Since:
1.2.3
See Also:
  • Method Details

    • name

      @NotNull @NotNull String name()
      The unique name of this template used to identify it.
      Returns:
      the name of this template
    • stages

      @NotNull @NotNull Collection<NecrifyTemplateStage> stages()
      Returns:
      a list of all stages compromised within this template
    • getStage

      @NotNull @NotNull NecrifyTemplateStage getStage(int index)
      Attempts to return the stage corresponding with the given index. If the index is out of bounds or there exist no stages, an exception is thrown.
      Parameters:
      index - the index of the stage
      Returns:
      the stage at the given index
      Throws:
      NoSuchElementException - if there are no stages
      IndexOutOfBoundsException - if the index is out of bounds
    • addStage

      @NotNull @NotNull CompletableFuture<Void> addStage(NecrifyTemplateStage stage)
      Adds a new stage to this template.
      Parameters:
      stage - the stage to add
      Returns:
      a CompletableFuture finishing either successfully or with an error but with no result value
    • delete

      Deletes this template. This will remove all stages added to this template.
      Returns:
      a CompletableFuture finishing either successfully or with an error but with no result value
    • removeStage

      NecrifyTemplateStage removeStage(int index)
      Removes the stage at the specified index from this template.
      Parameters:
      index - the index of the stage to be removed
      Returns:
      the removed stage that was previously located at the specified index
      Throws:
      IndexOutOfBoundsException - if the specified index is invalid or out of bounds