mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-12-29 04:28:10 +01:00
59 lines
1.8 KiB
Diff
59 lines
1.8 KiB
Diff
From 2bb9296d9afaaf35468b02144c6090359bc0eee1 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 00000000..c3de31cf
|
|
--- /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
|
|
|