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

    • breakTime

      public CustomBlockDefinition.Builder breakTime(double second)
      控制自定义方块客户端侧的挖掘时间(单位秒)

      自定义方块的挖掘时间取决于服务端侧和客户端侧中最小的一个

      Control the digging time (in seconds) on the client side of the custom block

      The digging time of a custom cube depends on the smallest of the server-side and client-side

    • creativeGroup

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

      Control the grouping of custom blocks in the creation inventory.

      See Also:
    • creativeGroup

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

      Control the grouping of custom blocks in the creation inventory.

      See Also:
    • transformation

      public CustomBlockDefinition.Builder transformation(@NotNull Transformation transformation)
      supports rotation, scaling, and translation. The component can be added to the whole block and/or to individual block permutations. Transformed geometries still have the same restrictions that non-transformed geometries have such as a maximum size of 30/16 units.
    • rotation

      public CustomBlockDefinition.Builder rotation(@NotNull 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)
      See Also:
    • geometry

      @Since("1.19.80-r1") public CustomBlockDefinition.Builder geometry(@NotNull Geometry 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

    • permutation

      @Since("1.19.80-r2") public CustomBlockDefinition.Builder permutation(Permutation permutation)
      控制自定义方块的变化特征,例如条件渲染,部分渲染等

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

    • permutations

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

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

    • 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
    • blockTags

      public CustomBlockDefinition.Builder blockTags(String... tag)
    • clientFriction

      @Since("1.20.0-r2") public CustomBlockDefinition.Builder clientFriction(float friction)
      客户端摩擦系数,用于控制玩家在自定义方块上行走的速度,值越大,移动越快。

      the client friction, which is used to control the speed at which the player walks on the custom block.The larger the value, the faster the movement.

    • customBuild

      public CustomBlockDefinition customBuild(@NotNull 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()