aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0106-Add-EntityTeleportEndGatewayEvent.patch
blob: 995b2328f6948c024e0fa76f97a93e4c986e6733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 9 Jun 2018 13:08:21 +0100
Subject: [PATCH] Add EntityTeleportEndGatewayEvent


diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityTeleportEndGatewayEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityTeleportEndGatewayEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..88b9c059f9d66877260c66496443ad0aefaf8f47
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityTeleportEndGatewayEvent.java
@@ -0,0 +1,33 @@
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.Location;
+import org.bukkit.block.EndGateway;
+import org.bukkit.entity.Entity;
+import org.bukkit.event.entity.EntityTeleportEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired any time an entity attempts to teleport in an end gateway
+ */
+public class EntityTeleportEndGatewayEvent extends EntityTeleportEvent {
+
+    @NotNull private final EndGateway gateway;
+
+    @ApiStatus.Internal
+    public EntityTeleportEndGatewayEvent(@NotNull Entity entity, @NotNull Location from, @NotNull Location to, @NotNull EndGateway gateway) {
+        super(entity, from, to);
+        this.gateway = gateway;
+    }
+
+    /**
+     * The gateway triggering the teleport
+     *
+     * @return EndGateway used
+     */
+    @NotNull
+    public EndGateway getGateway() {
+        return this.gateway;
+    }
+
+}