Class BlockAusgebeEreignis

All Implemented Interfaces:
Abbrechbar
Direct Known Subclasses:
BlockAusgebeRuestungEreignis

public class BlockAusgebeEreignis extends BlockEreignis implements Abbrechbar
Called when an item is dispensed from a block.

If a Block Dispense ereignis is cancelled, the block will not dispense the item.

  • Constructor Details

    • BlockAusgebeEreignis

      public BlockAusgebeEreignis(@NotNull Block block, @NotNull GegenstandsStapel dispensed, @NotNull Vektor velocity)
  • Method Details

    • getItem

      @NotNull public GegenstandsStapel getItem()
      Gets the item that is being dispensed. Modifying the returned item will have no effect, you must use setItem(GegenstandsStapel) instead.
      Returns:
      An GegenstandsStapel for the item being dispensed
    • setItem

      public void setItem(@NotNull GegenstandsStapel item)
      Sets the item being dispensed.
      Parameters:
      item - the item being dispensed
    • getVelocity

      @NotNull public Vektor getVelocity()
      Gets the velocity in meters per tick.

      Note: Modifying the returned Vektor will not change the velocity, you must use setVelocity(Vektor) instead.

      Returns:
      A Vektor for the dispensed item's velocity
    • setVelocity

      public void setVelocity(@NotNull Vektor vel)
      Sets the velocity of the item being dispensed in meters per tick.
      Parameters:
      vel - the velocity of the item being dispensed
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Abbrechbar
      Gets the cancellation state of this ereignis. A cancelled ereignis will not be executed in the server, but will still pass to other plugins
      Specified by:
      isCancelled in interface Abbrechbar
      Returns:
      true if this ereignis is cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: Abbrechbar
      Sets the cancellation state of this ereignis. A cancelled ereignis will not be executed in the server, but will still pass to other plugins.
      Specified by:
      setCancelled in interface Abbrechbar
      Parameters:
      cancel - true if you wish to cancel this ereignis
    • getHandlers

      @NotNull public HandhaberListe getHandlers()
      Specified by:
      getHandlers in class Ereignis
    • getHandlerList

      @NotNull public static HandhaberListe getHandlerList()