summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-05 10:17:43 +1000
committermd_5 <git@md-5.net>2018-08-05 10:17:43 +1000
commitd2834556b1032e98f2ff3125340e792bf19b0ec1 (patch)
treec3fbc4a30bfcd1198cc7f60dc80ba3dd326a2dd9 /src
parente07c38325891cfaf6915881b4998c39b830ab6ea (diff)
downloadbukkit-d2834556b1032e98f2ff3125340e792bf19b0ec1.tar
bukkit-d2834556b1032e98f2ff3125340e792bf19b0ec1.tar.gz
bukkit-d2834556b1032e98f2ff3125340e792bf19b0ec1.tar.lz
bukkit-d2834556b1032e98f2ff3125340e792bf19b0ec1.tar.xz
bukkit-d2834556b1032e98f2ff3125340e792bf19b0ec1.zip
SPIGOT-4219: Event for PigZombies angering.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/event/entity/PigZombieAngerEvent.java83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/entity/PigZombieAngerEvent.java b/src/main/java/org/bukkit/event/entity/PigZombieAngerEvent.java
new file mode 100644
index 00000000..5ad8a2a4
--- /dev/null
+++ b/src/main/java/org/bukkit/event/entity/PigZombieAngerEvent.java
@@ -0,0 +1,83 @@
+package org.bukkit.event.entity;
+
+import org.bukkit.Warning;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.PigZombie;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+
+/**
+ * Called when a Pig Zombie is angered by another entity.
+ * <p>
+ * If the event is cancelled, the pig zombie will not be angered.
+ *
+ * @deprecated draft API
+ */
+@Deprecated
+@Warning(false)
+public class PigZombieAngerEvent extends EntityEvent implements Cancellable {
+
+ private static final HandlerList handlers = new HandlerList();
+ private boolean canceled;
+ private final Entity target;
+ private int newAnger;
+
+ public PigZombieAngerEvent(final PigZombie pigZombie, final Entity target, final int newAnger) {
+ super(pigZombie);
+ this.target = target;
+ this.newAnger = newAnger;
+ }
+
+ /**
+ * Gets the entity (if any) which triggered this anger update.
+ *
+ * @return triggering entity, or null
+ */
+ public Entity getTarget() {
+ return target;
+ }
+
+ /**
+ * Gets the new anger resulting from this event.
+ *
+ * @return new anger
+ * @see PigZombie#getAnger()
+ */
+ public int getNewAnger() {
+ return newAnger;
+ }
+
+ /**
+ * Sets the new anger resulting from this event.
+ *
+ * @param newAnger the new anger
+ * @see PigZombie#setAnger(int)
+ */
+ public void setNewAnger(int newAnger) {
+ this.newAnger = newAnger;
+ }
+
+ @Override
+ public PigZombie getEntity() {
+ return (PigZombie) entity;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return canceled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ canceled = cancel;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}