Interface ItemHandler
- All Known Subinterfaces:
BlockDispenseHandler
,BlockUseHandler
,BowShootHandler
,EntityInteractHandler
,EntityKillHandler
,GlobalItemHandler
,ItemConsumptionHandler
,ItemDropHandler
,ItemUseHandler
,MultiBlockInteractionHandler
,ToolUseHandler
,WeaponUseHandler
- All Known Implementing Classes:
BlockBreakHandler
,BlockPlaceHandler
,BlockTicker
,RainbowTickHandler
,SimpleBlockBreakHandler
,VanillaInventoryDropHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An
ItemHandler
represents a certain action that a SlimefunItem
can perform.- Author:
- TheBusyBiscuit
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionClass<? extends ItemHandler>
This method returns the identifier for thisItemHandler
.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
This method is used to check whether a givenSlimefunItem
is compatible with thisItemHandler
, it will return anIncompatibleItemHandlerException
if the items are not compatible.- Parameters:
item
- TheSlimefunItem
to validate- Returns:
- An
Optional
describing the result, it will contain anIncompatibleItemHandlerException
should there be an issue
-
getIdentifier
This method returns the identifier for thisItemHandler
. We use aClass
identifier to group Item Handlers together.- Returns:
- The
Class
identifier for thisItemHandler
-