mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-23 02:55:27 +01:00
72 lines
2.0 KiB
Diff
72 lines
2.0 KiB
Diff
From 0f400e1f69af6ea50679b567ffdf4c986dda1be0 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 00000000..5e0a9bb4
|
|
--- /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
|
|
|