Class BlockAnalyzerSpigot

java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.util.api.BlockAnalyzerSpigot
All Implemented Interfaces:
IBlockAnalyzer<org.bukkit.Material>, IRestartable

public abstract class BlockAnalyzerSpigot extends Object implements IBlockAnalyzer<org.bukkit.Material>, IRestartable
Specialization of the block analyzer for the Spigot platform.

An instance of this class can be obtained through IAnimatedArchitecturePlatform.getBlockAnalyzer().

  • Constructor Details

  • Method Details

    • safeCreateBlockData

      @Nullable protected @Nullable org.bukkit.block.data.BlockData safeCreateBlockData(org.bukkit.Material material)
      Safely creates a BlockData object for a material.

      If an error occurs while creating the BlockData object, this method will log the error and return null.

      See Material.createBlockData().

      Parameters:
      material - The material to create the BlockData object for.
      Returns:
      The created BlockData object or null if an error occurred.
    • getDefaultMaterialStatus

      protected abstract IBlockAnalyzer.MaterialStatus getDefaultMaterialStatus(org.bukkit.Material material)
      Gets the default material status for a material.

      The default material status can be overridden by the blacklist provided by the configuration.

      Parameters:
      material - The material to get the default material status for.
      Returns:
      The default material status for the material.
    • isAirOrLiquid

      public boolean isAirOrLiquid(org.bukkit.Material material)
      Description copied from interface: IBlockAnalyzer
      Check if a block is air or liquid (water, lava).
      Specified by:
      isAirOrLiquid in interface IBlockAnalyzer<org.bukkit.Material>
      Parameters:
      material - The block to analyze.
      Returns:
      True if the block is air or liquid.
    • isAirOrLiquid

      public boolean isAirOrLiquid(ILocation location)
      Description copied from interface: IBlockAnalyzer
      Check if a block at a given location is air or liquid (water, lava).
      Specified by:
      isAirOrLiquid in interface IBlockAnalyzer<org.bukkit.Material>
      Parameters:
      location - The location of the block to analyze.
      Returns:
      True if the block is air or liquid.
    • isAllowed

      public boolean isAllowed(org.bukkit.Material material)
      Description copied from interface: IBlockAnalyzer
      Check if a block is on the blacklist of block that is not allowed for animations.
      Specified by:
      isAllowed in interface IBlockAnalyzer<org.bukkit.Material>
      Parameters:
      material - The block to analyze.
      Returns:
      True if the block can be used for animations.
    • initialize

      public final void initialize()
      Description copied from interface: IRestartable
      Handles the initialization.
      Specified by:
      initialize in interface IRestartable