类 AsyncStructureGenerateEvent
构造函数提供了一个布尔值来指示事件是同步还是异步触发的。当异步触发时,此事件可以从除主线程外的任意线程调用,并且对 API 的访问是受限的。
如果 Structure 是在世界区块中自然生成的,则此事件将是异步的。如果玩家执行了 '/place structure' 命令,则此事件将是同步的。
允许注册可以修改结构放置的方块和生成的实体的转换器。
应注意检查 Event.isAsynchronous() 并适当地处理事件。
-
嵌套类概要
嵌套类从类继承的嵌套类/接口 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移除所有方块转换器。void移除所有实体转换器。通过键获取方块转换器。获取所有方块转换器的不可修改映射。获取结构的边界框。getCause()获取事件原因。int获取结构起始区块的 x 坐标。int获取结构起始区块的 z 坐标。通过键获取实体转换器。获取所有实体转换器的不可修改映射。static @NotNull HandlerList获取生成的结构引用。void移除一个方块转换器。void移除一个实体转换器。voidsetBlockTransformer(@NotNull NamespacedKey key, @NotNull BlockTransformer transformer) 将方块转换器设置到指定键。voidsetEntityTransformer(@NotNull NamespacedKey key, @NotNull EntityTransformer transformer) 将实体转换器设置到指定键。从类继承的方法 org.bukkit.event.world.WorldEvent
getWorld从类继承的方法 org.bukkit.event.Event
getEventName, isAsynchronous
-
构造器详细资料
-
AsyncStructureGenerateEvent
-
-
方法详细资料
-
getCause
获取事件原因。- 返回:
- 事件原因
原文:Gets the event cause.
-
getBlockTransformer
@Nullable public @Nullable BlockTransformer getBlockTransformer(@NotNull @NotNull NamespacedKey key) 通过键获取方块转换器。- 参数:
key- 方块转换器的键- 返回:
- 方块转换器或 null
原文:Gets a block transformer by key.
-
setBlockTransformer
public void setBlockTransformer(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull BlockTransformer transformer) 将方块转换器设置到指定键。- 参数:
key- 键transformer- 方块转换器原文:Sets a block transformer to a key.
-
removeBlockTransformer
移除一个方块转换器。- 参数:
key- 方块转换器的键原文:Removes a block transformer.
-
clearBlockTransformers
public void clearBlockTransformers()移除所有方块转换器。原文:Removes all block transformers.
-
getBlockTransformers
获取所有方块转换器的不可修改映射。- 返回:
- 方块转换器的映射
原文:Gets all block transformers in a unmodifiable map.
-
getEntityTransformer
@Nullable public @Nullable EntityTransformer getEntityTransformer(@NotNull @NotNull NamespacedKey key) 通过键获取实体转换器。- 参数:
key- 实体转换器的键- 返回:
- 实体转换器或 null
原文:Gets a entity transformer by key.
-
setEntityTransformer
public void setEntityTransformer(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull EntityTransformer transformer) 将实体转换器设置到指定键。- 参数:
key- 键transformer- 实体转换器原文:Sets a entity transformer to a key.
-
removeEntityTransformer
移除一个实体转换器。- 参数:
key- 实体转换器的键原文:Removes a entity transformer.
-
clearEntityTransformers
public void clearEntityTransformers()移除所有实体转换器。原文:Removes all entity transformers.
-
getEntityTransformers
获取所有实体转换器的不可修改映射。- 返回:
- 实体转换器的映射
原文:Gets all entity transformers in a unmodifiable map.
-
getStructure
获取生成的结构引用。- 返回:
- 结构
原文:Get the structure reference that is generated.
-
getBoundingBox
获取结构的边界框。- 返回:
- 边界框
原文:Get the bounding box of the structure.
-
getChunkX
public int getChunkX()获取结构起始区块的 x 坐标。- 返回:
- 区块的 x 坐标
原文:Get the x coordinate of the origin chunk of the structure.
-
getChunkZ
public int getChunkZ()获取结构起始区块的 z 坐标。- 返回:
- 区块的 z 坐标
原文:Get the z coordinate of the origin chunk of the structure.
-
getHandlers
- 指定者:
getHandlers在类中Event
-
getHandlerList
-