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().
-
Nested Class Summary
Nested classes/interfaces inherited from interface IBlockAnalyzer
IBlockAnalyzer.MaterialStatus -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockAnalyzerSpigot(IBlockAnalyzerConfig config, RestartableHolder restartableHolder) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract IBlockAnalyzer.MaterialStatusgetDefaultMaterialStatus(org.bukkit.Material material) Gets the default material status for a material.final voidHandles the initialization.booleanisAirOrLiquid(ILocation location) Check if a block at a given location is air or liquid (water, lava).booleanisAirOrLiquid(org.bukkit.Material material) Check if a block is air or liquid (water, lava).booleanisAllowed(org.bukkit.Material material) Check if a block is on the blacklist of block that is not allowed for animations.protected @Nullable org.bukkit.block.data.BlockDatasafeCreateBlockData(org.bukkit.Material material) Safely creates aBlockDataobject for a material.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IRestartable
shutDown
-
Constructor Details
-
BlockAnalyzerSpigot
-
-
Method Details
-
safeCreateBlockData
protected @Nullable org.bukkit.block.data.BlockData safeCreateBlockData(org.bukkit.Material material) Safely creates aBlockDataobject for a material.If an error occurs while creating the
BlockDataobject, this method will log the error and returnnull.See
Material.createBlockData().- Parameters:
material- The material to create theBlockDataobject for.- Returns:
- The created
BlockDataobject ornullif 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:IBlockAnalyzerCheck if a block is air or liquid (water, lava).- Specified by:
isAirOrLiquidin interfaceIBlockAnalyzer<org.bukkit.Material>- Parameters:
material- The block to analyze.- Returns:
- True if the block is air or liquid.
-
isAirOrLiquid
Description copied from interface:IBlockAnalyzerCheck if a block at a given location is air or liquid (water, lava).- Specified by:
isAirOrLiquidin interfaceIBlockAnalyzer<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:IBlockAnalyzerCheck if a block is on the blacklist of block that is not allowed for animations.- Specified by:
isAllowedin interfaceIBlockAnalyzer<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:IRestartableHandles the initialization.- Specified by:
initializein interfaceIRestartable
-