Class CustomBlockDefinition.Builder

java.lang.Object
cn.nukkit.block.customblock.CustomBlockDefinition.Builder
Enclosing class:
CustomBlockDefinition

public static class CustomBlockDefinition.Builder extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • creativeGroup

      public CustomBlockDefinition.Builder creativeGroup(String creativeGroup)
      控制自定义方块在创造栏中的组。

      Control the grouping of custom blocks in the creation inventory.

      See Also:
    • rotation

      public CustomBlockDefinition.Builder rotation(@NonNull @NonNull Vector3f rotation)
      以度为单位设置块围绕立方体中心的旋转,旋转顺序为 xyz.角度必须是90的倍数。

      Set the rotation of the block around the center of the block in degrees, the rotation order is xyz. The angle must be a multiple of 90.

    • geometry

      public CustomBlockDefinition.Builder geometry(String geometry)
      控制自定义方块的几何模型,如果不设置默认为单位立方体

      Control the geometric model of the custom block, if not set the default is the unit cube.
      Geometry identifier from geo file in 'RP/models/blocks' folder

    • permutations

      public CustomBlockDefinition.Builder permutations(@NonNull @NonNull Permutations permutations)
      控制自定义方块的变化特征,例如条件渲染,部分渲染等

      Control custom block permutation features such as conditional rendering, partial rendering, etc.

    • partVisibility

      public CustomBlockDefinition.Builder partVisibility(@NotNull BoneCondition... boneConditions)
      条件渲染自定义方块的部分模型内容。

      Partially render the content of the custom block with conditional rendering.

    • collisionBox

      public CustomBlockDefinition.Builder collisionBox(@NotNull Vector3f origin, @NotNull Vector3f size)
      设置此方块的客户端碰撞箱。

      Set the client collision box for this block.

      Parameters:
      origin - 碰撞箱的原点 The origin of the collision box
      size - 碰撞箱的大小 The size of the collision box
    • selectionBox

      public CustomBlockDefinition.Builder selectionBox(@NotNull Vector3f origin, @NotNull Vector3f size)
      设置此方块的客户端选择箱。

      Set the client collision box for this block.

      Parameters:
      origin - 选择箱的原点 The origin of the collision box
      size - 选择箱的大小 The size of the collision box
    • customBuild

      public CustomBlockDefinition customBuild(@NonNull @NonNull Consumer<CompoundTag> nbt)
      对要发送给客户端的方块ComponentNBT进行自定义处理,这里包含了所有对自定义方块的定义。在符合条件的情况下,你可以任意修改。

      Custom processing of the block to be sent to the client ComponentNBT, which contains all definitions for custom block. You can modify them as much as you want, under the right conditions.

    • build

      public CustomBlockDefinition build()