Interface BlockDispenseHandler
- All Superinterfaces:
ItemHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
This
ItemHandler
is triggered when the SlimefunItem
it was assigned to
is a Dispenser
and was triggered.
This ItemHandler
is used for the BlockPlacer
.- Author:
- TheBusyBiscuit
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault Class<? extends ItemHandler>
This method returns the identifier for thisItemHandler
.void
onBlockDispense
(BlockDispenseEvent e, Dispenser dispenser, Block facedBlock, SlimefunItem machine) default Optional<IncompatibleItemHandlerException>
validate
(SlimefunItem item) This method is used to check whether a givenSlimefunItem
is compatible with thisItemHandler
, it will return anIncompatibleItemHandlerException
if the items are not compatible.
-
Method Details
-
validate
Description copied from interface:ItemHandler
This method is used to check whether a givenSlimefunItem
is compatible with thisItemHandler
, it will return anIncompatibleItemHandlerException
if the items are not compatible.- Specified by:
validate
in interfaceItemHandler
- Parameters:
item
- TheSlimefunItem
to validate- Returns:
- An
Optional
describing the result, it will contain anIncompatibleItemHandlerException
should there be an issue
-
onBlockDispense
void onBlockDispense(BlockDispenseEvent e, Dispenser dispenser, Block facedBlock, SlimefunItem machine) -
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
-