Class DominionCreateEvent
java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.ResultEvent
cn.lunadeer.dominion.events.dominion.DominionCreateEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Event triggered when a Dominion is created in the Dominion system.
Setting setSkipEconomy(true) can skip the economic system processing.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDominionCreateEvent(@NotNull org.bukkit.command.CommandSender operator, @NotNull String name, @NotNull UUID owner, @NotNull org.bukkit.World world, @NotNull CuboidDTO cuboid, @Nullable DominionDTO parent) Constructs a new DominionCreateEvent. -
Method Summary
Modifier and TypeMethodDescriptionafterCreated(Consumer<DominionDTO> consumer) Call back after the dominion is created.@NotNull CuboidDTOGets the cuboid representing the dominion's boundaries.@Nullable DominionDTODeprecated, 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 CompletableFuture that will be completed with the created DominionDTO.@NotNull StringgetName()Gets the name of the dominion.@NotNull UUIDgetOwner()Gets the owner of the dominion.@Nullable DominionDTOGets the parent dominion, or null if there is no parent.@NotNull org.bukkit.WorldgetWorld()Gets the world where the dominion is located.booleanGets whether the economic system processing is skipped.voidSets the cuboid representing the dominion's boundaries.voidsetDominion(@NotNull DominionDTO dominion) 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.voidSets the name of the dominion.voidSets the owner of the dominion.voidsetParent(@Nullable DominionDTO parent) Sets the parent dominion.voidsetSkipEconomy(boolean skipEconomy) Sets whether to skip the economic system processing.voidsetWorld(@NotNull org.bukkit.World world) Sets the world where the dominion is located.Methods inherited from class cn.lunadeer.dominion.events.ResultEvent
getOperator, isCancelled, setCancelledMethods inherited from class cn.lunadeer.dominion.events.CallableEvent
call, getHandlerList, getHandlersMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Field Details
-
world
public org.bukkit.World world
-
-
Constructor Details
-
DominionCreateEvent
public DominionCreateEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull String name, @NotNull @NotNull UUID owner, @NotNull @NotNull org.bukkit.World world, @NotNull @NotNull CuboidDTO cuboid, @Nullable @Nullable DominionDTO parent) Constructs a new DominionCreateEvent.- Parameters:
operator- the command sender who initiated the eventname- the name of the dominionowner- the owner of the dominionworld- the world where the dominion is locatedcuboid- the cuboid representing the dominion's boundariesparent- the parent dominion, or null if there is no parent
-
-
Method Details
-
setSkipEconomy
public void setSkipEconomy(boolean skipEconomy) Sets whether to skip the economic system processing.- Parameters:
skipEconomy- true to skip the economic system processing, false otherwise
-
isSkipEconomy
public boolean isSkipEconomy()Gets whether the economic system processing is skipped.- Returns:
- true if the economic system processing is skipped, false otherwise
-
getName
Gets the name of the dominion.- Returns:
- the name of the dominion
-
setName
Sets the name of the dominion.- Parameters:
name- the name of the dominion
-
getCuboid
Gets the cuboid representing the dominion's boundaries.- Returns:
- the cuboid representing the dominion's boundaries
-
setCuboid
Sets the cuboid representing the dominion's boundaries.- Parameters:
cuboid- the cuboid representing the dominion's boundaries
-
getWorld
@NotNull public @NotNull org.bukkit.World getWorld()Gets the world where the dominion is located.- Returns:
- the world where the dominion is located
-
setWorld
public void setWorld(@NotNull @NotNull org.bukkit.World world) Sets the world where the dominion is located.- Parameters:
world- the world where the dominion is located
-
getParent
Gets the parent dominion, or null if there is no parent.- Returns:
- the parent dominion, or null if there is no parent
-
setParent
Sets the parent dominion.- Parameters:
parent- the parent dominion
-
getOwner
Gets the owner of the dominion.- Returns:
- the owner of the dominion
-
setOwner
Sets the owner of the dominion.- Parameters:
owner- the owner of the dominion
-
getFutureToComplete
Gets the CompletableFuture that will be completed with the created DominionDTO.Under most circumstances, you should not need to use this method directly. If you need to perform actions after the dominion is created, you should use the
afterCreated(Consumer)method instead.- Returns:
- the CompletableFuture to be completed
-
afterCreated
Call back after the dominion is created.Use this method to perform actions after the dominion has been created (may fail), if you need to do something with the created dominion.
- Parameters:
consumer- the consumer to handle the created dominion- Returns:
- a CompletableFuture that completes when the consumer has been executed
-
getDominion
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. -
setDominion
@Deprecated(since="4.6.0", forRemoval=true) public void setDominion(@NotNull @NotNull DominionDTO dominion) 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.
-