aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-API-Patches/0007-Entity-Origin-API.patch
blob: 6355ad23944bf0fea1f9dc378ad0cfd4ffcad81c (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 80f0b1f242c4e32979a05cc74f0e482c2fdbc0fa Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Mon, 29 Feb 2016 17:50:31 -0600
Subject: [PATCH] Entity Origin API


diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index e5fc22a..ef6d467 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -391,4 +391,15 @@ public interface Entity extends Metadatable, CommandSender {
 
     Spigot spigot();
     // Spigot End
+
+    // Paper start
+    /**
+     * Gets the location where this entity originates from.
+     * <p>
+     * This value can be null if the entity hasn't yet been added to the world.
+     *
+     * @return Location where entity originates or null if not yet added
+     */
+    Location getOrigin();
+    // Paper end
 }
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
index bc56fa2..360e149 100644
--- a/src/main/java/org/bukkit/entity/FallingBlock.java
+++ b/src/main/java/org/bukkit/entity/FallingBlock.java
@@ -59,4 +59,13 @@ public interface FallingBlock extends Entity {
      * @param hurtEntities whether entities will be damaged by this block.
      */
     void setHurtEntities(boolean hurtEntities);
+
+    /**
+     * Gets the source block location of the FallingBlock
+     *
+     * @return the source block location the FallingBlock was spawned from
+     * @deprecated replaced by {@link Entity#getOrigin()}
+     */
+    @Deprecated
+    public org.bukkit.Location getSourceLoc();
 }
diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java
index 3ce322d..69df487 100644
--- a/src/main/java/org/bukkit/entity/TNTPrimed.java
+++ b/src/main/java/org/bukkit/entity/TNTPrimed.java
@@ -35,4 +35,13 @@ public interface TNTPrimed extends Explosive {
      * @return the source of this primed TNT
      */
     public Entity getSource();
+
+    /**
+     * Gets the source block location of the TNTPrimed
+     *
+     * @return the source block location the TNTPrimed was spawned from
+     * @deprecated replaced by {@link Entity#getOrigin()}
+     */
+    @Deprecated
+    public org.bukkit.Location getSourceLoc();
 }
-- 
2.8.0