Class BlockPlaceHandler

java.lang.Object
io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler
All Implemented Interfaces:
ItemHandler

public abstract class BlockPlaceHandler extends Object implements 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 Details

    • BlockPlaceHandler

      protected BlockPlaceHandler(boolean allowBlockPlacers)
  • Method Details

    • onPlayerPlace

      public abstract void onPlayerPlace(@Nonnull org.bukkit.event.block.BlockPlaceEvent e)
      This method is called whenever a Player placed this Block.
      Parameters:
      e - The corresponding BlockPlaceEvent
    • onBlockPlacerPlace

      public void onBlockPlacerPlace(@Nonnull BlockPlacerPlaceEvent e)
      This method is called whenever a BlockPlacer places this Block. You cannot cancel the BlockPlacerPlaceEvent from within this method! Override the method isBlockPlacerAllowed() instead if you want to disallow the BlockPlacer from placing this Block.
      Parameters:
      e - The corresponding BlockPlacerPlaceEvent
    • isBlockPlacerAllowed

      public boolean isBlockPlacerAllowed()
      This returns whether the BlockPlacer is allowed to place a Block of this type.
      Returns:
      Whether a BlockPlacer is allowed to place this
    • getIdentifier

      public final Class<? extends ItemHandler> getIdentifier()
      Description copied from interface: ItemHandler
      This method returns the identifier for this ItemHandler. We use a Class identifier to group Item Handlers together.
      Specified by:
      getIdentifier in interface ItemHandler
      Returns:
      The Class identifier for this ItemHandler