summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-08-08 18:24:14 +1000
committermd_5 <git@md-5.net>2016-08-08 18:24:14 +1000
commitb513e19ee0ddd8e0dab895dc3a195a5a91a87989 (patch)
treeb6e434c8fff6f50a198131a689b1d2ddfa09bcc6
parent18490e51b1665bf838cebd163d11f1aabde4cffe (diff)
downloadbukkit-b513e19ee0ddd8e0dab895dc3a195a5a91a87989.tar
bukkit-b513e19ee0ddd8e0dab895dc3a195a5a91a87989.tar.gz
bukkit-b513e19ee0ddd8e0dab895dc3a195a5a91a87989.tar.lz
bukkit-b513e19ee0ddd8e0dab895dc3a195a5a91a87989.tar.xz
bukkit-b513e19ee0ddd8e0dab895dc3a195a5a91a87989.zip
SPIGOT-2581: EntityAirChangeEvent
-rw-r--r--src/main/java/org/bukkit/event/entity/EntityAirChangeEvent.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/entity/EntityAirChangeEvent.java b/src/main/java/org/bukkit/event/entity/EntityAirChangeEvent.java
new file mode 100644
index 00000000..0c9de8e3
--- /dev/null
+++ b/src/main/java/org/bukkit/event/entity/EntityAirChangeEvent.java
@@ -0,0 +1,59 @@
+package org.bukkit.event.entity;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+
+/**
+ * Called when the amount of air an entity has remaining changes.
+ */
+public class EntityAirChangeEvent extends EntityEvent implements Cancellable {
+
+ private static final HandlerList handlers = new HandlerList();
+ //
+ private int amount;
+ //
+ private boolean cancelled;
+
+ public EntityAirChangeEvent(Entity what, int amount) {
+ super(what);
+ this.amount = amount;
+ }
+
+ /**
+ * Gets the amount of air the entity has left (measured in ticks).
+ *
+ * @return amount of air remaining
+ */
+ public int getAmount() {
+ return amount;
+ }
+
+ /**
+ * Sets the amount of air remaining for the entity (measured in ticks.
+ *
+ * @param amount amount of air remaining
+ */
+ public void setAmount(int amount) {
+ this.amount = amount;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}