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 is created within a dominion.
This event is triggered when a group is added.
After a successful addition, the new group can be obtained via getGroup()
.
If the addition fails, getGroup()
returns null.
-
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 TypeMethodDescription@NotNull DominionDTO
Gets the dominion to which the group belongs.@Nullable GroupDTO
getGroup()
Gets the newly created group.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
Sets the group being created.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
-
setGroup
Sets the group being created.- Parameters:
group
- the group to set
-
getGroup
Gets the newly created group. If the addition fails, returns null.- Returns:
- the newly created group, or null if the addition fails
-