Package de.eimmer.ereignis.spieler
Class SpielerGegenstandKonsumierEreignis
java.lang.Object
de.eimmer.ereignis.Ereignis
de.eimmer.ereignis.spieler.SpielerEreignis
de.eimmer.ereignis.spieler.SpielerGegenstandKonsumierEreignis
- All Implemented Interfaces:
Abbrechbar
This ereignis will fire when a spieler is finishing consuming an item (food,
zaubertrank, milk bucket).
If the GegenstandsStapel is modified the server will use the effects of the new item and not remove the original one from the spieler's inventar.
If the ereignis is cancelled the effect will not be applied and the item will not be removed from the spieler's inventar.
If the GegenstandsStapel is modified the server will use the effects of the new item and not remove the original one from the spieler's inventar.
If the ereignis is cancelled the effect will not be applied and the item will not be removed from the spieler's inventar.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.eimmer.ereignis.Ereignis
Ereignis.Result
-
Field Summary
Fields inherited from class de.eimmer.ereignis.spieler.SpielerEreignis
spieler
-
Constructor Summary
ConstructorsConstructorDescriptionSpielerGegenstandKonsumierEreignis
(Spieler spieler, GegenstandsStapel item) Deprecated.SpielerGegenstandKonsumierEreignis
(Spieler spieler, GegenstandsStapel item, AusstattungsSpalte hand) -
Method Summary
Modifier and TypeMethodDescriptiongetHand()
Get the hand used to consume the item.static HandhaberListe
getItem()
Gets the item that is being consumed.boolean
Gets the cancellation state of this ereignis.void
setCancelled
(boolean cancel) Sets the cancellation state of this ereignis.void
setItem
(GegenstandsStapel item) Set the item being consumedMethods inherited from class de.eimmer.ereignis.spieler.SpielerEreignis
getPlayer
Methods inherited from class de.eimmer.ereignis.Ereignis
getEventName, isAsynchronous
-
Constructor Details
-
SpielerGegenstandKonsumierEreignis
public SpielerGegenstandKonsumierEreignis(@NotNull Spieler spieler, @NotNull GegenstandsStapel item, @NotNull AusstattungsSpalte hand) - Parameters:
spieler
- the spieler consumingitem
- the GegenstandsStapel being consumedhand
- the hand that was used
-
SpielerGegenstandKonsumierEreignis
@Deprecated public SpielerGegenstandKonsumierEreignis(@NotNull Spieler spieler, @NotNull GegenstandsStapel item) - Parameters:
spieler
- the spieler consumingitem
- the GegenstandsStapel being consumed
-
-
Method Details
-
getItem
Gets the item that is being consumed. Modifying the returned item will have no effect, you must usesetItem(GegenstandsStapel)
instead.- Returns:
- an GegenstandsStapel for the item being consumed
-
setItem
Set the item being consumed- Parameters:
item
- the item being consumed
-
getHand
Get the hand used to consume the item.- Returns:
- the hand
-
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
-
SpielerGegenstandKonsumierEreignis(Spieler, GegenstandsStapel, AusstattungsSpalte)