神岛 API 文档 - ArenaPro版
    Preparing search index...

    GameVoxels 提供了游戏中所有方块的接口。您可以使用它来控制地形。

    Index

    Advanced

    • Parameters

      • x: number
      • y: number
      • z: number

      Returns number

      检索指定坐标处方块的数字 ID。这是 getVoxel 的一个更高效的版本。 返回的方块 ID 是带旋转码的 ID。

      Retrieves the numeric ID of the voxel at the specified coordinates. This is a more performant version of getVoxel. The returned ID includes rotation bits.

      x 坐标。

      The x-coordinate.

      y 坐标。

      The y-coordinate.

      z 坐标。

      The z-coordinate.

      带旋转码的方块数值 ID。

      The numeric voxel ID including rotation bits.

    • Parameters

      • x: number
      • y: number
      • z: number
      • voxel: number
      • Optionalrotation: 0

      Returns voxelId

      在指定坐标处设置一个方块,并返回该方块的数字 ID。

      Sets a voxel at the given coordinates and returns its numeric ID.

      x 坐标。

      The x-coordinate.

      y 坐标。

      The y-coordinate.

      z 坐标。

      The z-coordinate.

      要设置的方块数字 ID,可包含旋转码。

      The numeric voxel ID to set, which may include rotation bits.

      可选的旋转码,为 0 或未传入时表示不使用旋转。

      Optional rotation code. 0 or undefined means no rotation.

      若未使用旋转,返回不带旋转码的 voxelId;否则返回 0

      Returns a plain voxelId when no rotation is used; otherwise returns 0.

    • Parameters

      Returns number

      在指定坐标处设置一个带旋转信息的方块,并返回完整的数值 ID。 传入的 voxel 为基础方块 ID,最终返回的 ID 将包含旋转码。

      Sets a voxel with rotation at the given coordinates and returns the full numeric ID including rotation bits. The voxel argument is the base ID, and the returned value includes the rotation.

      x 坐标。

      The x-coordinate.

      y 坐标。

      The y-coordinate.

      z 坐标。

      The z-coordinate.

      基础方块数值 ID(不含旋转码)。

      The base numeric voxel ID (without rotation bits).

      旋转码,将编码进返回的 ID 中。

      The rotation code that will be encoded into the returned ID.

      带旋转码的数值 ID。

      The numeric ID including rotation bits.

    • Parameters

      Returns voxelId

      在指定坐标处通过方块 ID 或方块名设置一个方块(不使用旋转,或旋转为 0), 并返回不带旋转码的 voxelId,否则返回 0

      Sets a voxel at the given coordinates using a voxelId or voxelName without rotation (or with rotation 0) and returns a plain voxelId. When rotation is not applicable, 0 is returned.

      x 坐标。

      The x-coordinate.

      y 坐标。

      The y-coordinate.

      z 坐标。

      The z-coordinate.

      要设置的方块,可以是方块 ID 或方块名。

      The voxel to set, either as a voxelId or a voxelName.

      可选旋转码,为 0 或未传入时表示不使用旋转。

      Optional rotation code. 0 or undefined means no rotation.

      成功设置且不含旋转信息时返回 voxelId,否则返回 0

      Returns a voxelId when set without rotation; otherwise returns 0.

    • Parameters

      Returns number

      在指定坐标处通过方块 ID 或方块名设置一个带旋转的方块, 返回带旋转码的完整数值 ID。

      Sets a voxel with rotation at the given coordinates using either a voxelId or a voxelName, and returns the full numeric ID including rotation bits.

      x 坐标。

      The x-coordinate.

      y 坐标。

      The y-coordinate.

      z 坐标。

      The z-coordinate.

      要设置的方块,可以是方块 ID 或方块名。

      The voxel to set, either as a voxelId or a voxelName.

      旋转码,将编码进返回的 ID 中。

      The rotation code that will be encoded into the returned ID.

      带旋转码的数值 ID。

      The numeric ID including rotation bits.

    • Parameters

      • x: number
      • y: number
      • z: number
      • voxel: number

      Returns number

      使用方块的数字 ID 在指定坐标处设置一个方块。这是 setVoxel 的一个更高效的版本。

      Sets a voxel at the specified coordinates using its numeric ID. This is a more performant version of setVoxel.

      x 坐标。

      The x-coordinate.

      y 坐标。

      The y-coordinate.

      z 坐标。

      The z-coordinate.

      要设置的方块的 ID。

      The ID of the voxel to set.

      更新后位置的方块 ID。

      The voxel ID of the updated position.

    • Parameters

      • x: number
      • y: number
      • z: number
      • voxel: number

      Returns number

      在指定坐标处通过数值 ID 设置一个方块,并返回最终写入的数值 ID。 此处 voxel 可以是带旋转码的 ID,返回值同样是带旋转码的 ID。

      Sets a voxel at the given coordinates using a numeric ID and returns the actual ID that is stored. The voxel argument may already include rotation bits, and the returned value will also include them.

      x 坐标。

      The x-coordinate.

      y 坐标。

      The y-coordinate.

      z 坐标。

      The z-coordinate.

      方块的数值 ID,可以包含旋转码。

      The numeric voxel ID to set, which may include rotation bits.

      实际写入的数值 ID(可能包含旋转码)。

      The numeric ID actually stored (possibly including rotation bits).

    • Parameters

      • x: number
      • y: number
      • z: number
      • voxel: voxelId

      Returns voxelId

      在指定坐标处通过 voxelId 设置一个方块。 若传入的是不带旋转码的 voxelId,返回值也为不带旋转码的 voxelId; 若无法设置则返回 0

      Sets a voxel at the given coordinates using a voxelId. If the provided ID is a plain voxelId without rotation bits, the returned value is also a plain voxelId; otherwise 0 is returned.

      x 坐标。

      The x-coordinate.

      y 坐标。

      The y-coordinate.

      z 坐标。

      The z-coordinate.

      方块的 voxelId(不包含旋转码)。

      The voxelId of the voxel (without rotation bits).

      设置成功时返回 voxelId,否则返回 0

      Returns the voxelId on success, or 0 if it fails.

    Grid

    getVoxel: (x: number, y: number, z: number) => voxelId

    Type declaration

      • (x: number, y: number, z: number): voxelId
      • Parameters

        • x: number
        • y: number
        • z: number

        Returns voxelId

    获取指定坐标处的方块 ID。

    Gets the voxel ID at the specified coordinates.

    x 坐标。

    The x-coordinate.

    y 坐标。

    The y-coordinate.

    z 坐标。

    The z-coordinate.

    指定坐标处的方块 ID。

    The voxel ID at the specified coordinates.

    getVoxelRotation: (x: number, y: number, z: number) => voxelRotation

    Type declaration

    获取指定坐标处方块的旋转代码。

    Gets the rotation code of the voxel at the specified coordinates.

    x 坐标。

    The x-coordinate.

    y 坐标。

    The y-coordinate.

    z 坐标。

    The z-coordinate.

    指定坐标处方块的旋转代码。

    The rotation code of the voxel at the specified coordinates.

    方块网格在 x、y、z 维度上的大小。

    The size of the voxel grid in the x, y, and z dimensions.

    Other

    • Parameters

      • id: number

      Returns voxelName

      根据方块的数值 ID 获取对应的方块名称。 传入带旋转码的 ID 也可以正常解析为方块名。

      Resolves the voxel name from a numeric voxel ID. IDs that include rotation bits are also supported and will be correctly mapped to the base voxel name.

      方块的数值 ID,可以包含旋转码。

      The numeric voxel ID, possibly including rotation bits.

      与该 ID 对应的方块名称。

      The voxel name corresponding to the given ID.

    Voxel

    id: (name: voxelName) => voxelId

    Type declaration

    根据方块的可读名称获取其数字 ID。如果名称无效,则返回 0。

    Gets the numeric ID of a voxel from its human-readable name. Returns 0 if the name is invalid.

    方块的可读名称。

    The human-readable name of the voxel.

    方块的数字 ID,如果名称无效则为 0。

    The numeric ID of the voxel, or 0 if the name is invalid.

    VoxelTypes: string[]

    游戏中所有支持的方块类型的名称数组。

    An array of names for all supported voxel types in the game.