Class BlockPlaceHandler
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler
- All Implemented Interfaces:
ItemHandler
This
ItemHandler is called whenever a Block was placed.
This only listens to any Block of the same SlimefunItem this is assigned
to.- Author:
- TheBusyBiscuit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Class<? extends ItemHandler>This method returns the identifier for thisItemHandler.booleanThis returns whether theBlockPlaceris allowed to place aBlockof this type.voidThis method is called whenever aBlockPlacerplaces thisBlock.abstract voidMethods 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
-
BlockPlaceHandler
protected BlockPlaceHandler(boolean allowBlockPlacers)
-
-
Method Details
-
onPlayerPlace
- Parameters:
e- The correspondingBlockPlaceEvent
-
onBlockPlacerPlace
This method is called whenever aBlockPlacerplaces thisBlock. You cannot cancel theBlockPlacerPlaceEventfrom within this method! Override the methodisBlockPlacerAllowed()instead if you want to disallow theBlockPlacerfrom placing thisBlock.- Parameters:
e- The correspondingBlockPlacerPlaceEvent
-
isBlockPlacerAllowed
public boolean isBlockPlacerAllowed()This returns whether theBlockPlaceris allowed to place aBlockof this type.- Returns:
- Whether a
BlockPlaceris allowed to place this
-
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
-