Package org.bukkit.event.world
Class 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.
 
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Constructor SummaryConstructorsConstructorDescriptionAsyncStructureGenerateEvent(World world, boolean async, AsyncStructureGenerateEvent.Cause cause, Structure structure, BoundingBox boundingBox, int chunkX, int chunkZ) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidRemoves all block transformers.voidRemoves 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.intGet the x coordinate of the origin chunk of the structure.intGet 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 HandlerListGet the structure reference that is generated.voidRemoves a block transformer.voidRemoves a entity transformer.voidsetBlockTransformer(NamespacedKey key, BlockTransformer transformer) Sets a block transformer to a key.voidsetEntityTransformer(NamespacedKey key, EntityTransformer transformer) Sets a entity transformer to a key.Methods inherited from class org.bukkit.event.world.WorldEventgetWorldMethods inherited from class org.bukkit.event.EventgetEventName, isAsynchronous
- 
Constructor Details- 
AsyncStructureGenerateEventpublic AsyncStructureGenerateEvent(@NotNull World world, boolean async, @NotNull AsyncStructureGenerateEvent.Cause cause, @NotNull Structure structure, @NotNull BoundingBox boundingBox, int chunkX, int chunkZ) 
 
- 
- 
Method Details- 
getCauseGets the event cause.- Returns:
- the event cause
 
- 
getBlockTransformerGets a block transformer by key.- Parameters:
- key- the key of the block transformer
- Returns:
- the block transformer or null
 
- 
setBlockTransformerSets a block transformer to a key.- Parameters:
- key- the key
- transformer- the block transformer
 
- 
removeBlockTransformerRemoves a block transformer.- Parameters:
- key- the key of the block transformer
 
- 
clearBlockTransformerspublic void clearBlockTransformers()Removes all block transformers.
- 
getBlockTransformersGets all block transformers in a unmodifiable map.- Returns:
- the block transformers in a map
 
- 
getEntityTransformerGets a entity transformer by key.- Parameters:
- key- the key of the entity transformer
- Returns:
- the entity transformer or null
 
- 
setEntityTransformerpublic void setEntityTransformer(@NotNull NamespacedKey key, @NotNull EntityTransformer transformer) Sets a entity transformer to a key.- Parameters:
- key- the key
- transformer- the entity transformer
 
- 
removeEntityTransformerRemoves a entity transformer.- Parameters:
- key- the key of the entity transformer
 
- 
clearEntityTransformerspublic void clearEntityTransformers()Removes all entity transformers.
- 
getEntityTransformersGets all entity transformers in a unmodifiable map.- Returns:
- the entity transformers in a map
 
- 
getStructureGet the structure reference that is generated.- Returns:
- the structure
 
- 
getBoundingBoxGet the bounding box of the structure.- Returns:
- the bounding box
 
- 
getChunkXpublic int getChunkX()Get the x coordinate of the origin chunk of the structure.- Returns:
- the chunk x coordinate
 
- 
getChunkZpublic int getChunkZ()Get the z coordinate of the origin chunk of the structure.- Returns:
- the chunk z coordinate
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-