Class VanillaInventoryDropHandler<T extends org.bukkit.block.BlockState & org.bukkit.inventory.InventoryHolder>

java.lang.Object
io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler
io.github.thebusybiscuit.slimefun4.implementation.handlers.VanillaInventoryDropHandler<T>
Type Parameters:
T - The type of BlockState and InventoryHolder we are dealing with
All Implemented Interfaces:
ItemHandler

public class VanillaInventoryDropHandler<T extends org.bukkit.block.BlockState & org.bukkit.inventory.InventoryHolder> extends BlockBreakHandler
This is an implementation of BlockBreakHandler which is suited for any SlimefunItem that uses the vanilla Inventory from the BlockState.

The default behaviour is the following:

 | Broken by... | Behaviour                |
 | ------------ | ------------------------ |
 | Player       | Drop inventory contents. |
 | Android      | Not allowed.             |
 | Explosions   | Delete contents.         |
 
Author:
TheBusyBiscuit
  • Constructor Details

    • VanillaInventoryDropHandler

      public VanillaInventoryDropHandler(@Nonnull Class<T> blockStateClass)
      This creates a new VanillaInventoryDropHandler for the given BlockState Class.
      Parameters:
      blockStateClass - The class of the block's BlockState
  • Method Details

    • onPlayerBreak

      @ParametersAreNonnullByDefault public void onPlayerBreak(org.bukkit.event.block.BlockBreakEvent e, org.bukkit.inventory.ItemStack item, List<org.bukkit.inventory.ItemStack> drops)
      Specified by:
      onPlayerBreak in class BlockBreakHandler
    • getInventory

      @Nonnull protected org.bukkit.inventory.Inventory getInventory(@Nonnull T inventoryHolder)