Class Materials

java.lang.Object
cn.nukkit.block.customblock.data.Materials

@PowerNukkitXOnly @Since("1.19.31-r1") public class Materials extends Object
用于将方块的face(面)映射到实际的材质实例,并且设置渲染方法和参数

Used to map the face of a block to a material instance, and set the rendering method and parameters.

  • Method Details

    • builder

      public static Materials builder()
      Builder materials.
      Returns:
      the materials
    • up

      public Materials up(Materials.RenderMethod renderMethod, String texture)
      ambientOcclusion=true, faceDimming=true
      See Also:
    • up

      public Materials up(Materials.RenderMethod renderMethod, boolean ambientOcclusion, boolean faceDimming, String texture)
      指定up面对应的渲染方法、渲染参数和材质。

      Specify the corresponding rendering method, rendering parameters and texture's name for the up face.

      Parameters:
      renderMethod - 要使用的渲染方法
      Rendering method to be used
      texture - 指定up方向的材质名称
      Specify the texture's name of the up face
      ambientOcclusion - 在照明时是否应该应用环境光遮蔽?
      Should I apply ambient light shielding when lighting?
      faceDimming - 是否应该根据它所面对的方向变暗?
      Should it be dimmed according to the direction it is facing?
      Returns:
      the materials
    • down

      public Materials down(Materials.RenderMethod renderMethod, String texture)
      ambientOcclusion=true, faceDimming=true
      See Also:
    • down

      public Materials down(Materials.RenderMethod renderMethod, boolean ambientOcclusion, boolean faceDimming, String texture)
      指定down面对应的渲染方法、渲染参数和材质。

      Specify the corresponding rendering method, rendering parameters and texture's name for the down face.

      Parameters:
      renderMethod - 要使用的渲染方法
      Rendering method to be used
      texture - 指定down方向的材质名称
      Specify the texture's name of the down face
      ambientOcclusion - 在照明时是否应该应用环境光遮蔽?
      Should I apply ambient light shielding when lighting?
      faceDimming - 是否应该根据它所面对的方向变暗?
      Should it be dimmed according to the direction it is facing?
      Returns:
      the materials
    • north

      public Materials north(Materials.RenderMethod renderMethod, String texture)
      ambientOcclusion=true, faceDimming=true
      See Also:
    • north

      public Materials north(Materials.RenderMethod renderMethod, boolean ambientOcclusion, boolean faceDimming, String texture)
      指定north面对应的渲染方法、渲染参数和材质。

      Specify the corresponding rendering method, rendering parameters and texture's name for the north face.

      Parameters:
      renderMethod - 要使用的渲染方法
      Rendering method to be used
      texture - 指定north方向的材质名称
      Specify the texture's name of the north face
      ambientOcclusion - 在照明时是否应该应用环境光遮蔽?
      Should I apply ambient light shielding when lighting?
      faceDimming - 是否应该根据它所面对的方向变暗?
      Should it be dimmed according to the direction it is facing?
      Returns:
      the materials
    • south

      public Materials south(Materials.RenderMethod renderMethod, String texture)
      ambientOcclusion=true, faceDimming=true
      See Also:
    • south

      public Materials south(Materials.RenderMethod renderMethod, boolean ambientOcclusion, boolean faceDimming, String texture)
      指定south面对应的渲染方法、渲染参数和材质。

      Specify the corresponding rendering method, rendering parameters and texture's name for the south face.

      Parameters:
      renderMethod - 要使用的渲染方法
      Rendering method to be used
      texture - 指定south方向的材质名称
      Specify the texture's name of the south face
      ambientOcclusion - 在照明时是否应该应用环境光遮蔽?
      Should I apply ambient light shielding when lighting?
      faceDimming - 是否应该根据它所面对的方向变暗?
      Should it be dimmed according to the direction it is facing?
      Returns:
      the materials
    • east

      public Materials east(Materials.RenderMethod renderMethod, String texture)
      ambientOcclusion=true, faceDimming=true
      See Also:
    • east

      public Materials east(Materials.RenderMethod renderMethod, boolean ambientOcclusion, boolean faceDimming, String texture)
      指定east面对应的渲染方法、渲染参数和材质。

      Specify the corresponding rendering method, rendering parameters and texture's name for the east face.

      Parameters:
      renderMethod - 要使用的渲染方法
      Rendering method to be used
      texture - 指定east方向的材质名称
      Specify the texture's name of the east face
      ambientOcclusion - 在照明时是否应该应用环境光遮蔽?
      Should I apply ambient light shielding when lighting?
      faceDimming - 是否应该根据它所面对的方向变暗?
      Should it be dimmed according to the direction it is facing?
      Returns:
      the materials
    • west

      public Materials west(Materials.RenderMethod renderMethod, String texture)
      ambientOcclusion=true, faceDimming=true
      See Also:
    • west

      public Materials west(Materials.RenderMethod renderMethod, boolean ambientOcclusion, boolean faceDimming, String texture)
      指定west面对应的渲染方法、渲染参数和材质。

      Specify the corresponding rendering method, rendering parameters and texture's name for the west face.

      Parameters:
      renderMethod - 要使用的渲染方法
      Rendering method to be used
      texture - 指定west方向的材质名称
      Specify the texture's name of the west face
      ambientOcclusion - 在照明时是否应该应用环境光遮蔽?
      Should I apply ambient light shielding when lighting?
      faceDimming - 是否应该根据它所面对的方向变暗?
      Should it be dimmed according to the direction it is facing?
      Returns:
      the materials
    • any

      public Materials any(Materials.RenderMethod renderMethod, String texture)
      ambientOcclusion=true, faceDimming=true
      See Also:
    • any

      public Materials any(Materials.RenderMethod renderMethod, boolean ambientOcclusion, boolean faceDimming, String texture)
      指定所有面对应的渲染方法、渲染参数和材质。

      Specify all corresponding rendering method, rendering parameters and texture name.

      Parameters:
      renderMethod - 要使用的渲染方法
      Rendering method to be used
      texture - 材质名称
      Specify the texture's name
      ambientOcclusion - 在照明时是否应该应用环境光遮蔽?
      Should I apply ambient light shielding when lighting?
      faceDimming - 是否应该根据它所面对的方向变暗?
      Should it be dimmed according to the direction it is facing?
      Returns:
      the materials
    • process

      public void process(@NonNull @NonNull String face, boolean ambientOcclusion, boolean faceDimming, @NonNull @NonNull String renderMethodName, @NonNull @NonNull String texture)
      指定对应对应的渲染方法、渲染参数和材质。此方法是完全自定义的,请在使用之前抓包确认参数合法性
      Parameters:
      face - 指定面的名称,可选值为:up, down, north, south, east, west, *
      ambientOcclusion - 在照明时是否应该应用环境光遮蔽?
      Should it be applied ambient light shielding when lighting?
      faceDimming - 是否应该根据它所面对的方向变暗?
      Should it be dimmed according to the direction it is facing?
      renderMethodName - 要使用的渲染方法
      Rendering method to be used
      texture - 材质名称
      Specify the texture's name
    • build

      public CompoundTag build()