Class GlowDispenser

All Implemented Interfaces:
com.destroystokyo.paper.loottable.LootableBlockInventory, com.destroystokyo.paper.loottable.LootableInventory, org.bukkit.block.BlockState, org.bukkit.block.Container, org.bukkit.block.Dispenser, org.bukkit.block.Lockable, org.bukkit.block.TileState, org.bukkit.inventory.BlockInventoryHolder, org.bukkit.inventory.InventoryHolder, org.bukkit.loot.Lootable, org.bukkit.metadata.Metadatable, org.bukkit.Nameable, org.bukkit.persistence.PersistentDataHolder, org.bukkit.projectiles.BlockProjectileSource, org.bukkit.projectiles.ProjectileSource
Direct Known Subclasses:
GlowDropper

public class GlowDispenser extends GlowContainer implements org.bukkit.block.Dispenser, org.bukkit.projectiles.BlockProjectileSource
  • Constructor Details

    • GlowDispenser

      public GlowDispenser(GlowBlock block)
  • Method Details

    • register

      public static void register()
      Registers all vanilla dispense behaviors.
    • getBlockProjectileSource

      public org.bukkit.projectiles.BlockProjectileSource getBlockProjectileSource()
      Specified by:
      getBlockProjectileSource in interface org.bukkit.block.Dispenser
    • dispense

      public boolean dispense()
      Specified by:
      dispense in interface org.bukkit.block.Dispenser
    • getDispenseBehavior

      protected DispenseBehavior getDispenseBehavior(org.bukkit.Material itemType)
      Returns the dispense behavior that will dispense this type of item.
      Parameters:
      itemType - the item type to dispense
      Returns:
      the dispense behavior
    • getDispenseSlot

      public int getDispenseSlot()
    • placeInDispenser

      public org.bukkit.inventory.ItemStack placeInDispenser(org.bukkit.inventory.ItemStack toPlace)
      Puts as much as possible of an ItemStack in the dispenser, and returns the rest.
      Parameters:
      toPlace - the item stack
      Returns:
      the portion of the item stack that didn't fit in the dispenser, or null if it all fit
    • getInventory

      public org.bukkit.inventory.Inventory getInventory()
      Specified by:
      getInventory in interface org.bukkit.block.Container
      Specified by:
      getInventory in interface org.bukkit.inventory.InventoryHolder
      Overrides:
      getInventory in class GlowContainer
    • update

      public boolean update(boolean force, boolean applyPhysics)
      Specified by:
      update in interface org.bukkit.block.BlockState
      Overrides:
      update in class GlowBlockState
    • launchProjectile

      public <T extends org.bukkit.entity.Projectile> T launchProjectile(Class<? extends T> projectile)
      Specified by:
      launchProjectile in interface org.bukkit.projectiles.ProjectileSource
    • launchProjectile

      public <T extends org.bukkit.entity.Projectile> T launchProjectile(Class<? extends T> projectile, org.bukkit.util.Vector velocity)
      Specified by:
      launchProjectile in interface org.bukkit.projectiles.ProjectileSource
    • getDispenseBehaviorRegistry

      public static DispenseBehaviorRegistry getDispenseBehaviorRegistry()