Package de.eimmer.ereignis.block
Class BlockAusgebeEreignis
java.lang.Object
de.eimmer.ereignis.Ereignis
de.eimmer.ereignis.block.BlockEreignis
de.eimmer.ereignis.block.BlockAusgebeEreignis
- All Implemented Interfaces:
Abbrechbar
- Direct Known Subclasses:
BlockAusgebeRuestungEreignis
Called when an item is dispensed from a block.
If a Block Dispense ereignis is cancelled, the block will not dispense the item.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.eimmer.ereignis.Ereignis
Ereignis.Result
-
Field Summary
Fields inherited from class de.eimmer.ereignis.block.BlockEreignis
block
-
Constructor Summary
ConstructorsConstructorDescriptionBlockAusgebeEreignis
(Block block, GegenstandsStapel dispensed, Vektor velocity) -
Method Summary
Modifier and TypeMethodDescriptionstatic HandhaberListe
getItem()
Gets the item that is being dispensed.Gets the velocity in meters per tick.boolean
Gets the cancellation state of this ereignis.void
setCancelled
(boolean cancel) Sets the cancellation state of this ereignis.void
setItem
(GegenstandsStapel item) Sets the item being dispensed.void
setVelocity
(Vektor vel) Sets the velocity of the item being dispensed in meters per tick.Methods inherited from class de.eimmer.ereignis.block.BlockEreignis
getBlock
Methods inherited from class de.eimmer.ereignis.Ereignis
getEventName, isAsynchronous
-
Constructor Details
-
BlockAusgebeEreignis
public BlockAusgebeEreignis(@NotNull Block block, @NotNull GegenstandsStapel dispensed, @NotNull Vektor velocity)
-
-
Method Details
-
getItem
Gets the item that is being dispensed. Modifying the returned item will have no effect, you must usesetItem(GegenstandsStapel)
instead.- Returns:
- An GegenstandsStapel for the item being dispensed
-
setItem
Sets the item being dispensed.- Parameters:
item
- the item being dispensed
-
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
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 interfaceAbbrechbar
- 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 interfaceAbbrechbar
- Parameters:
cancel
- true if you wish to cancel this ereignis
-
getHandlers
- Specified by:
getHandlers
in classEreignis
-
getHandlerList
-