Interface CustomBlock


public interface CustomBlock
继承这个类实现自定义方块 重写Block中的方法控制方块属性
  • Method Details

    • getNamespace

      String getNamespace()
      控制自定义方块的命名空间
      (例如 wiki:test_block)
    • getTexture

      String getTexture()
      控制自定义方块所用的材质名称
      (例如材质图片test.png设置test)
    • getFrictionFactor

      double getFrictionFactor()
    • getResistance

      double getResistance()
    • getLightFilter

      int getLightFilter()
    • getLightLevel

      int getLightLevel()
    • calculateBreakTime

      double calculateBreakTime()
    • getId

      default int getId()
    • getName

      default String getName()
    • toItem

      Item toItem()
    • toCustomBlock

      default Block toCustomBlock()
    • toCustomBlock

      default Block toCustomBlock(int meta)
    • getCreativeCategory

      default String getCreativeCategory()
      控制自定义方块在创造栏中的分类,默认值construction
      See Also:
    • getCreativeCategoryGroup

      default String getCreativeCategoryGroup()
      控制自定义方块在创造栏中的组
      See Also:
    • getMaterials

      default CompoundTag getMaterials()
      将几何文件中的face(面)名称映射到实际的材质实例
    • getRotation

      default Vector3 getRotation()
      以度为单位设置块围绕立方体中心的旋转,旋转顺序为 xyz.角度必须是90的倍数。
    • getBlockTags

      @Nullable default ListTag<StringTag> getBlockTags()
    • getGeometry

      default String getGeometry()
      控制自定义方块的形状
      Geometry identifier from geo file in 'RP/models/blocks' folder
    • getPermutations

      @Nullable default ListTag<CompoundTag> getPermutations()
      控制自定义方块的客户端状态
      Returns:
      Permutations NBT Tag
    • getPropertiesNBT

      @Nullable default ListTag<CompoundTag> getPropertiesNBT()
      获取方块属性NBT定义
      Returns:
      BlockProperties in NBT Tag format
    • componentNBTProcessor

      default CompoundTag componentNBTProcessor(CompoundTag componentNBT)
      对自动生成的ComponentNBT进行处理
      Parameters:
      componentNBT - 自动生成的component NBT
      Returns:
      处理后的ComponentNBT
    • getBlockPropertyData

      default BlockPropertyData getBlockPropertyData()