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
ModifierConstructorDescriptionprotected
BlockBreakHandler
(boolean allowAndroids, boolean allowExplosions) This constructs a newBlockBreakHandler
. -
Method Summary
Modifier and TypeMethodDescriptionfinal Class<? extends ItemHandler>
This method returns the identifier for thisItemHandler
.boolean
This returns whether aMinerAndroid
is allowed to break the givenBlock
.boolean
This returns whether an explosion is able to break the givenBlock
.void
void
abstract void
onPlayerBreak
(BlockBreakEvent e, ItemStack item, List<ItemStack> drops) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 aMinerAndroid
is 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 aMinerAndroid
is allowed to break the givenBlock
. -
getIdentifier
Description copied from interface:ItemHandler
This method returns the identifier for thisItemHandler
. We use aClass
identifier to group Item Handlers together.- Specified by:
getIdentifier
in interfaceItemHandler
- Returns:
- The
Class
identifier for thisItemHandler
-