Commits
md_5 authored b513e19ee0d
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 + | |
7 + | /** |
8 + | * Called when the amount of air an entity has remaining changes. |
9 + | */ |
10 + | public class EntityAirChangeEvent extends EntityEvent implements Cancellable { |
11 + | |
12 + | private static final HandlerList handlers = new HandlerList(); |
13 + | // |
14 + | private int amount; |
15 + | // |
16 + | private boolean cancelled; |
17 + | |
18 + | public EntityAirChangeEvent(Entity what, int amount) { |
19 + | super(what); |
20 + | this.amount = amount; |
21 + | } |
22 + | |
23 + | /** |
24 + | * Gets the amount of air the entity has left (measured in ticks). |
25 + | * |
26 + | * @return amount of air remaining |
27 + | */ |
28 + | public int getAmount() { |
29 + | return amount; |
30 + | } |
31 + | |
32 + | /** |
33 + | * Sets the amount of air remaining for the entity (measured in ticks. |
34 + | * |
35 + | * @param amount amount of air remaining |
36 + | */ |
37 + | public void setAmount(int amount) { |
38 + | this.amount = amount; |
39 + | } |
40 + | |
41 + | |
42 + | public boolean isCancelled() { |
43 + | return cancelled; |
44 + | } |
45 + | |
46 + | |
47 + | public void setCancelled(boolean cancelled) { |
48 + | this.cancelled = cancelled; |
49 + | } |
50 + | |
51 + | |
52 + | public HandlerList getHandlers() { |
53 + | return handlers; |
54 + | } |
55 + | |
56 + | public static HandlerList getHandlerList() { |
57 + | return handlers; |
58 + | } |
59 + | } |