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
-
Method Summary
Modifier and TypeMethodDescriptionfinal Class<? extends ItemHandler>
This method returns the identifier for thisItemHandler
.boolean
This returns whether theBlockPlacer
is allowed to place aBlock
of this type.void
This method is called whenever aBlockPlacer
places thisBlock
.abstract void
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
-
BlockPlaceHandler
protected BlockPlaceHandler(boolean allowBlockPlacers)
-
-
Method Details
-
onPlayerPlace
- Parameters:
e
- The correspondingBlockPlaceEvent
-
onBlockPlacerPlace
This method is called whenever aBlockPlacer
places thisBlock
. You cannot cancel theBlockPlacerPlaceEvent
from within this method! Override the methodisBlockPlacerAllowed()
instead if you want to disallow theBlockPlacer
from placing thisBlock
.- Parameters:
e
- The correspondingBlockPlacerPlaceEvent
-
isBlockPlacerAllowed
public boolean isBlockPlacerAllowed()This returns whether theBlockPlacer
is allowed to place aBlock
of this type.- Returns:
- Whether a
BlockPlacer
is allowed to place this
-
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
-