Yatopia/patches/api/0016-EMC-ZombieReinforcementEvent.patch

72 lines
2.0 KiB
Diff
Raw Normal View History

2020-06-16 16:46:05 +02:00
From 722bce9bc9d33ac4873ff44fb36ffe5da33d6507 Mon Sep 17 00:00:00 2001
2020-02-26 20:12:29 +01:00
From: Aikar <aikar@aikar.co>
Date: Sun, 4 Dec 2016 15:27:06 -0500
Subject: [PATCH] EMC ZombieReinforcementEvent
---
.../ZombieReinforcementEvent.java | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 src/main/java/com/empireminecraft/customevents/ZombieReinforcementEvent.java
diff --git a/src/main/java/com/empireminecraft/customevents/ZombieReinforcementEvent.java b/src/main/java/com/empireminecraft/customevents/ZombieReinforcementEvent.java
new file mode 100644
2020-06-16 16:46:05 +02:00
index 00000000..5e0a9bb4
2020-02-26 20:12:29 +01:00
--- /dev/null
+++ b/src/main/java/com/empireminecraft/customevents/ZombieReinforcementEvent.java
@@ -0,0 +1,52 @@
+package com.empireminecraft.customevents;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+
+public class ZombieReinforcementEvent extends EntityEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private final LivingEntity targetEntity;
+ private double chance;
+
+ public ZombieReinforcementEvent(Entity sourceZombie, LivingEntity targetEntity, double chance) {
+ super(sourceZombie);
+ this.targetEntity = targetEntity;
+ this.chance = chance;
+ }
+
+
+ public LivingEntity getTargetEntity() {
+ return targetEntity;
+ }
+
+ public double getChance() {
+ return chance;
+ }
+
+ public void setChance(double chance) {
+ this.chance = chance;
+ }
+
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ private boolean cancelled = false;
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ cancelled = cancel;
+ }
+}
--
2.25.1.windows.1