Class GroupCreateEvent

java.lang.Object
org.bukkit.event.Event
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class GroupCreateEvent extends ResultEvent
Event triggered when a group of a dominion is created.
  • Constructor Details

    • GroupCreateEvent

      public GroupCreateEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion, @NotNull @NotNull String groupName)
      Constructs a new GroupCreateEvent.
      Parameters:
      operator - the command sender who initiated the event
      dominion - the dominion to which the group belongs
      groupName - the name of the group being created
  • Method Details

    • setDominion

      public void setDominion(@NotNull @NotNull DominionDTO dominion)
      Sets the dominion to which the group belongs.
      Parameters:
      dominion - the dominion to set
    • getDominion

      @NotNull public @NotNull DominionDTO getDominion()
      Gets the dominion to which the group belongs.
      Returns:
      the dominion
    • setGroupNameColored

      public void setGroupNameColored(String groupName)
      Sets the name of the group with color codes.
      Parameters:
      groupName - the name of the group with color codes
    • getGroupNameColored

      public String getGroupNameColored()
      Gets the name of the group with color codes.
      Returns:
      the name of the group with color codes
    • getGroupNamePlain

      public String getGroupNamePlain()
      Gets the plain text name of the group without color codes.
      Returns:
      the plain text name of the group
    • getFutureToComplete

      public CompletableFuture<GroupDTO> getFutureToComplete()
      Gets the CompletableFuture that will be completed with the created GroupDTO.

      Under most circumstances, you should not need to use this method directly. If you need to perform actions after the group is created, you should use the afterCreated(Consumer) method instead.

      Returns:
      the CompletableFuture to be completed
    • afterCreated

      public CompletableFuture<Void> afterCreated(Consumer<GroupDTO> consumer)
      Call back after the group is created.

      Use this method to perform actions after the group has been created (may fail), if you need to do something with the created group,

      Parameters:
      consumer - the consumer to handle the created group
      Returns:
      a CompletableFuture that completes when the consumer has been executed
    • setGroup

      @Deprecated(since="4.6.0", forRemoval=true) public void setGroup(@NotNull @NotNull GroupDTO group)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated and will be removed in future versions.
      Parameters:
      group - the group to set
    • getGroup

      @Deprecated(since="4.6.0", forRemoval=true) @Nullable public @Nullable GroupDTO getGroup()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated and will be removed in future versions. To get the created dominion, use the afterCreated(Consumer) method instead.