Commits
md_5 authored 309497c12f5
1 + | package org.bukkit.event.entity; |
2 + | |
3 + | import org.bukkit.entity.Entity; |
4 + | import org.bukkit.event.Cancellable; |
5 + | import org.bukkit.event.HandlerList; |
6 + | import org.jetbrains.annotations.NotNull; |
7 + | |
8 + | /** |
9 + | * Called when an entity stops riding another entity. |
10 + | */ |
11 + | public class EntityDismountEvent extends EntityEvent implements Cancellable { |
12 + | |
13 + | private static final HandlerList handlers = new HandlerList(); |
14 + | private boolean cancelled; |
15 + | private final Entity dismounted; |
16 + | |
17 + | public EntityDismountEvent( Entity what, Entity dismounted) { |
18 + | super(what); |
19 + | this.dismounted = dismounted; |
20 + | } |
21 + | |
22 + | /** |
23 + | * Gets the entity which will no longer be ridden. |
24 + | * |
25 + | * @return dismounted entity |
26 + | */ |
27 + | |
28 + | public Entity getDismounted() { |
29 + | return dismounted; |
30 + | } |
31 + | |
32 + | |
33 + | public boolean isCancelled() { |
34 + | return cancelled; |
35 + | } |
36 + | |
37 + | |
38 + | public void setCancelled(boolean cancel) { |
39 + | this.cancelled = cancel; |
40 + | } |
41 + | |
42 + | |
43 + | |
44 + | public HandlerList getHandlers() { |
45 + | return handlers; |
46 + | } |
47 + | |
48 + | |
49 + | public static HandlerList getHandlerList() { |
50 + | return handlers; |
51 + | } |
52 + | } |