Interface BlockXpSource

All Superinterfaces:
XpSource

public interface BlockXpSource extends XpSource
  • Method Details

    • getBlock

      String getBlock()
      Gets the block name of the source. If there are multiple blocks, it will return the first one.
      Returns:
      The block name
    • getBlocks

      String[] getBlocks()
      Gets an array of block names of the source.
      Returns:
      The block names. If there is only one block, it will return an array with one element.
    • getTriggers

      Gets an array of triggers of the source.
      Returns:
      The triggers. If there is only one trigger, it will return an array with one element.
    • checkReplace

      boolean checkReplace()
      Gets whether placements of the block by the player should be tracked. Only naturally generated blocks will give xp if this is true.
      Returns:
      Whether placements of the block by the player should be tracked
    • getStates

      @Nullable @Nullable BlockXpSource.BlockXpSourceState[] getStates()
      Gets the valid block states of the source.
      Returns:
      The valid block states. If there are no block states set (all block state valid), it will return null.
    • getAfterStates

      @Nullable @Nullable BlockXpSource.BlockXpSourceState[] getAfterStates()
      Gets the block states the block must be one tick after interacting with the source block in order for XP to be given.
      Returns:
      the required block states after interaction
    • getStateMultiplier

      double getStateMultiplier(String stateKey, Object stateValue)
      Gets the multiplier for the xp of the source based on the block state. If there is no block state multiplier set, it will always return 1.
      Parameters:
      stateKey - The key of the block state used as a variable in the multiplier
      stateValue - The value of the block state variable to calculate the multiplier
      Returns:
      The multiplier
    • hasStateMultiplier

      boolean hasStateMultiplier()
    • requiresSupportBlock

      boolean requiresSupportBlock(BlockXpSource.SupportBlockType direction)
      Gets whether the source requires a support block. If this is true, the source will only give xp if the block below it is a valid support block.
      Parameters:
      direction - The direction of the support block
      Returns:
      Whether the source requires a support block
    • isTrunk

      boolean isTrunk()
    • isLeaf

      boolean isLeaf()