类 AsyncStructureGenerateEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.world.WorldEvent
org.bukkit.event.world.AsyncStructureGenerateEvent

@Experimental public class AsyncStructureGenerateEvent extends WorldEvent
此事件有时会同步触发,取决于其触发方式。

构造函数提供了一个布尔值来指示事件是同步还是异步触发的。当异步触发时,此事件可以从除主线程外的任意线程调用,并且对 API 的访问是受限的。

如果 Structure 是在世界区块中自然生成的,则此事件将是异步的。如果玩家执行了 '/place structure' 命令,则此事件将是同步的。 允许注册可以修改结构放置的方块和生成的实体的转换器。

应注意检查 Event.isAsynchronous() 并适当地处理事件。

  • 构造器详细资料

  • 方法详细资料

    • getCause

      获取事件原因。
      返回:
      事件原因

      原文:Gets the event cause.

    • getBlockTransformer

      通过键获取方块转换器。
      参数:
      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

      public void removeBlockTransformer(@NotNull @NotNull NamespacedKey key)
      移除一个方块转换器。
      参数:
      key - 方块转换器的键

      原文:Removes a block transformer.

    • clearBlockTransformers

      public void clearBlockTransformers()
      移除所有方块转换器。

      原文:Removes all block transformers.

    • getBlockTransformers

      @NotNull public @NotNull Map<NamespacedKey,BlockTransformer> getBlockTransformers()
      获取所有方块转换器的不可修改映射。
      返回:
      方块转换器的映射

      原文:Gets all block transformers in a unmodifiable map.

    • getEntityTransformer

      通过键获取实体转换器。
      参数:
      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

      public void removeEntityTransformer(@NotNull @NotNull NamespacedKey key)
      移除一个实体转换器。
      参数:
      key - 实体转换器的键

      原文:Removes a entity transformer.

    • clearEntityTransformers

      public void clearEntityTransformers()
      移除所有实体转换器。

      原文:Removes all entity transformers.

    • getEntityTransformers

      @NotNull public @NotNull Map<NamespacedKey,EntityTransformer> getEntityTransformers()
      获取所有实体转换器的不可修改映射。
      返回:
      实体转换器的映射

      原文:Gets all entity transformers in a unmodifiable map.

    • getStructure

      @NotNull public @NotNull Structure getStructure()
      获取生成的结构引用。
      返回:
      结构

      原文:Get the structure reference that is generated.

    • getBoundingBox

      @NotNull public @NotNull BoundingBox 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

      @NotNull public @NotNull HandlerList getHandlers()
      指定者:
      getHandlers 在类中 Event
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()