类 AsyncStructureGenerateEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.world.WorldEvent
org.bukkit.event.world.AsyncStructureGenerateEvent
This event will sometimes fire synchronously, depending on how it was
triggered.
The constructor provides a boolean to indicate if the event was fired synchronously or asynchronously. When asynchronous, this event can be called from any thread, sans the main thread, and has limited access to the API.
If a Structure
is naturally placed in a chunk of the world, this
event will be asynchronous. If a player executes the '/place structure'
command, this event will be synchronous.
Allows to register transformers that can modify the blocks placed and
entities spawned by the structure.
Care should be taken to check Event.isAsynchronous()
and treat the event
appropriately.
-
嵌套类概要
从类继承的嵌套类/接口 org.bukkit.event.Event
Event.Result
-
构造器概要
构造器说明AsyncStructureGenerateEvent
(@NotNull World world, boolean async, @NotNull AsyncStructureGenerateEvent.Cause cause, @NotNull Structure structure, @NotNull BoundingBox boundingBox, int chunkX, int chunkZ) -
方法概要
修饰符和类型方法说明void
Removes all block transformers.void
Removes all entity transformers.Gets a block transformer by key.Gets all block transformers in a unmodifiable map.Get the bounding box of the structure.getCause()
Gets the event cause.int
Get the x coordinate of the origin chunk of the structure.int
Get the z coordinate of the origin chunk of the structure.Gets a entity transformer by key.Gets all entity transformers in a unmodifiable map.static @NotNull HandlerList
Get the structure reference that is generated.void
Removes a block transformer.void
Removes a entity transformer.void
setBlockTransformer
(@NotNull NamespacedKey key, @NotNull BlockTransformer transformer) Sets a block transformer to a key.void
setEntityTransformer
(@NotNull NamespacedKey key, @NotNull EntityTransformer transformer) Sets a entity transformer to a key.从类继承的方法 org.bukkit.event.world.WorldEvent
getWorld
从类继承的方法 org.bukkit.event.Event
getEventName, isAsynchronous
-
构造器详细资料
-
AsyncStructureGenerateEvent
-
-
方法详细资料
-
getCause
Gets the event cause.- 返回:
- the event cause
-
getBlockTransformer
@Nullable public @Nullable BlockTransformer getBlockTransformer(@NotNull @NotNull NamespacedKey key) Gets a block transformer by key.- 参数:
key
- the key of the block transformer- 返回:
- the block transformer or null
-
setBlockTransformer
public void setBlockTransformer(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull BlockTransformer transformer) Sets a block transformer to a key.- 参数:
key
- the keytransformer
- the block transformer
-
removeBlockTransformer
Removes a block transformer.- 参数:
key
- the key of the block transformer
-
clearBlockTransformers
public void clearBlockTransformers()Removes all block transformers. -
getBlockTransformers
Gets all block transformers in a unmodifiable map.- 返回:
- the block transformers in a map
-
getEntityTransformer
@Nullable public @Nullable EntityTransformer getEntityTransformer(@NotNull @NotNull NamespacedKey key) Gets a entity transformer by key.- 参数:
key
- the key of the entity transformer- 返回:
- the entity transformer or null
-
setEntityTransformer
public void setEntityTransformer(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull EntityTransformer transformer) Sets a entity transformer to a key.- 参数:
key
- the keytransformer
- the entity transformer
-
removeEntityTransformer
Removes a entity transformer.- 参数:
key
- the key of the entity transformer
-
clearEntityTransformers
public void clearEntityTransformers()Removes all entity transformers. -
getEntityTransformers
Gets all entity transformers in a unmodifiable map.- 返回:
- the entity transformers in a map
-
getStructure
Get the structure reference that is generated.- 返回:
- the structure
-
getBoundingBox
Get the bounding box of the structure.- 返回:
- the bounding box
-
getChunkX
public int getChunkX()Get the x coordinate of the origin chunk of the structure.- 返回:
- the chunk x coordinate
-
getChunkZ
public int getChunkZ()Get the z coordinate of the origin chunk of the structure.- 返回:
- the chunk z coordinate
-
getHandlers
- 指定者:
getHandlers
在类中Event
-
getHandlerList
-