Class BlockWood

All Implemented Interfaces:
BlockID, IBlockState, IMutableBlockState, AxisAlignedBB, Metadatable, Cloneable
Direct Known Subclasses:
BlockWood2, BlockWoodBark, BlockWoodMangrove, BlockWoodStripped

@PowerNukkitDifference(info="Extends BlockLog instead of BlockSolidMeta only in PowerNukkit", since="1.4.0.0-PN") public class BlockWood extends BlockLog
Author:
MagicDroidX (Nukkit Project)
  • Field Details

  • Constructor Details

    • BlockWood

      public BlockWood()
    • BlockWood

      public BlockWood(int meta)
  • Method Details

    • getId

      public int getId()
      Specified by:
      getId in class Block
    • getProperties

      @Since("1.4.0.0-PN") @PowerNukkitOnly @NotNull public BlockProperties getProperties()
      Description copied from class: Block
      The properties that fully describe all possible and valid states that this block can have.
      Specified by:
      getProperties in interface IBlockState
      Specified by:
      getProperties in class BlockLog
    • getHardness

      public double getHardness()
      Description copied from class: Block
      控制方块硬度
      Overrides:
      getHardness in class Block
      Returns:
      方块的硬度
    • getResistance

      public double getResistance()
      Description copied from class: Block
      控制方块爆炸抗性
      Overrides:
      getResistance in class Block
      Returns:
      方块的爆炸抗性
    • getWoodType

      @PowerNukkitOnly @Since("1.4.0.0-PN") public WoodType getWoodType()
    • setWoodType

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setWoodType(WoodType woodType)
    • getName

      public String getName()
      Specified by:
      getName in class Block
    • forState

      @Since("1.5.1.0-PN") @PowerNukkitOnly @NotNull public Block forState(@NotNull IBlockState state) throws InvalidBlockStateException
      Description copied from interface: IMutableBlockState
      Replace all matching states of this block state with the same states of the given block state. But giving opportunity to return a new instance of this mutable state if needed.

      States that doesn't exists in the other state are ignored.

      Only properties that matches each other will be copied, for example, if this state have an age property going from 0 to 7 and the other have an age from 0 to 15, the age property won't change.

      If the implementation recognizes that the given state does not match the current set of properties and needs an update, it may update and return a new state with a different block id and different set of properties that represent the expected visual state. The this change can be detected with an == operation.

      Specified by:
      forState in interface IMutableBlockState
      Overrides:
      forState in class Block
      Parameters:
      state - The states that will have the properties copied.
      Throws:
      InvalidBlockStateException - If the given storage has invalid data properties
    • getBurnChance

      public int getBurnChance()
      Description copied from class: Block
      这个值越大,这个方块本身越容易起火 返回-1,这个方块不能被点燃

      The higher this value, the more likely the block itself is to catch fire

      Overrides:
      getBurnChance in class Block
      Returns:
      the burn chance
    • getBurnAbility

      public int getBurnAbility()
      Description copied from class: Block
      这个值越大,越有可能被旁边的火焰引燃

      The higher this value, the more likely it is to be ignited by the fire next to it

      Overrides:
      getBurnAbility in class Block
    • getStrippedState

      @PowerNukkitOnly protected BlockState getStrippedState()
      Specified by:
      getStrippedState in class BlockLog