Class BlockBreakHandler
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler
- All Implemented Interfaces:
ItemHandler
- Direct Known Subclasses:
SimpleBlockBreakHandler,VanillaInventoryDropHandler
The
BlockBreakHandler is called when a Block is broken
which holds a SlimefunItem.
The BlockBreakHandler provides three methods for this, one for block breaking
caused by a Player, one for a MinerAndroid and one method for a Block
being destroyed by an explosion.- Author:
- TheBusyBiscuit
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockBreakHandler(boolean allowAndroids, boolean allowExplosions) This constructs a newBlockBreakHandler. -
Method Summary
Modifier and TypeMethodDescriptionfinal Class<? extends ItemHandler>This method returns the identifier for thisItemHandler.booleanThis returns whether aMinerAndroidis allowed to break the givenBlock.booleanThis returns whether an explosion is able to break the givenBlock.voidvoidabstract voidonPlayerBreak(BlockBreakEvent e, ItemStack item, List<ItemStack> drops) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.api.items.ItemHandler
validate
-
Constructor Details
-
BlockBreakHandler
protected BlockBreakHandler(boolean allowAndroids, boolean allowExplosions) This constructs a newBlockBreakHandler.- Parameters:
allowAndroids- Whether aMinerAndroidis allowed to break blocks of this typeallowExplosions- Whether blocks of this type are allowed to be broken by explosions
-
-
Method Details
-
onPlayerBreak
@ParametersAreNonnullByDefault public abstract void onPlayerBreak(BlockBreakEvent e, ItemStack item, List<ItemStack> drops) -
onExplode
-
onAndroidBreak
-
isExplosionAllowed
This returns whether an explosion is able to break the givenBlock. -
isAndroidAllowed
This returns whether aMinerAndroidis allowed to break the givenBlock. -
getIdentifier
Description copied from interface:ItemHandlerThis method returns the identifier for thisItemHandler. We use aClassidentifier to group Item Handlers together.- Specified by:
getIdentifierin interfaceItemHandler- Returns:
- The
Classidentifier for thisItemHandler
-