Yatopia/patches/api/0025-EMC-Add-ConduitNewTargetEvent.patch
2020-05-12 19:47:53 +02:00

59 lines
1.8 KiB
Diff

From f574c7d8d40084036ced9d39ae1c068b4a7a31e4 Mon Sep 17 00:00:00 2001
From: chickeneer <emcchickeneer@gmail.com>
Date: Sun, 14 Jul 2019 13:50:18 -0500
Subject: [PATCH] EMC Add ConduitNewTargetEvent
---
.../customevents/ConduitNewTargetEvent.java | 39 +++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 src/main/java/com/empireminecraft/customevents/ConduitNewTargetEvent.java
diff --git a/src/main/java/com/empireminecraft/customevents/ConduitNewTargetEvent.java b/src/main/java/com/empireminecraft/customevents/ConduitNewTargetEvent.java
new file mode 100644
index 000000000..c3de31cf5
--- /dev/null
+++ b/src/main/java/com/empireminecraft/customevents/ConduitNewTargetEvent.java
@@ -0,0 +1,39 @@
+package com.empireminecraft.customevents;
+
+import org.bukkit.block.Block;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.block.BlockEvent;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+public class ConduitNewTargetEvent extends BlockEvent {
+ private static final HandlerList handlers = new HandlerList();
+ private final List<LivingEntity> entities;
+
+ public ConduitNewTargetEvent(List<LivingEntity> entities, @NotNull Block theBlock) {
+ super(theBlock);
+ this.entities = entities;
+ }
+
+ /**
+ * Remove entities from this list to remove them from the potential targets of the conduit.
+ * Implementation will not use any additions to this list.
+ *
+ * @return
+ */
+ public List<LivingEntity> potentialTargets() {
+ return entities;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
--
2.25.1.windows.1