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 givenSlimefunItemis compatible with thisItemHandler, it will return anIncompatibleItemHandlerExceptionif the items are not compatible.
-
Method Details
-
validate
This method is used to check whether a givenSlimefunItemis compatible with thisItemHandler, it will return anIncompatibleItemHandlerExceptionif the items are not compatible.- Parameters:
item- TheSlimefunItemto validate- Returns:
- An
Optionaldescribing the result, it will contain anIncompatibleItemHandlerExceptionshould there be an issue
-
getIdentifier
This method returns the identifier for thisItemHandler. We use aClassidentifier to group Item Handlers together.- Returns:
- The
Classidentifier for thisItemHandler
-