Class GroupCreateEvent
java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.ResultEvent
cn.lunadeer.dominion.events.group.GroupCreateEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Event triggered when a group of a dominion is created.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionGroupCreateEvent
(@NotNull org.bukkit.command.CommandSender operator, @NotNull DominionDTO dominion, @NotNull String groupName) Constructs a new GroupCreateEvent. -
Method Summary
Modifier and TypeMethodDescriptionafterCreated
(Consumer<GroupDTO> consumer) Call back after the group is created.@NotNull DominionDTO
Gets the dominion to which the group belongs.Gets the CompletableFuture that will be completed with the created GroupDTO.@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.Gets the name of the group with color codes.Gets the plain text name of the group without color codes.void
setDominion
(@NotNull DominionDTO dominion) Sets the dominion to which the group belongs.void
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.void
setGroupNameColored
(String groupName) Sets the name of the group with color codes.Methods inherited from class cn.lunadeer.dominion.events.ResultEvent
getOperator, isCancelled, setCancelled
Methods inherited from class cn.lunadeer.dominion.events.CallableEvent
call, getHandlerList, getHandlers
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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 eventdominion
- the dominion to which the group belongsgroupName
- the name of the group being created
-
-
Method Details
-
setDominion
Sets the dominion to which the group belongs.- Parameters:
dominion
- the dominion to set
-
getDominion
Gets the dominion to which the group belongs.- Returns:
- the dominion
-
setGroupNameColored
Sets the name of the group with color codes.- Parameters:
groupName
- the name of the group with color codes
-
getGroupNameColored
Gets the name of the group with color codes.- Returns:
- the name of the group with color codes
-
getGroupNamePlain
Gets the plain text name of the group without color codes.- Returns:
- the plain text name of the group
-
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
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, 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, 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 theafterCreated(Consumer)
method instead.
-