2020-04-02 21:07:06 +00:00
|
|
|
From fe1924a542c1c342b0c6d8e83c026b6f608216dc Mon Sep 17 00:00:00 2001
|
2016-02-29 23:09:49 +00:00
|
|
|
From: Byteflux <byte@byteflux.net>
|
|
|
|
Date: Mon, 29 Feb 2016 17:50:31 -0600
|
2016-03-25 09:02:35 +00:00
|
|
|
Subject: [PATCH] Entity Origin API
|
2016-02-29 23:09:49 +00:00
|
|
|
|
|
|
|
|
2016-03-25 09:02:35 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
2020-04-02 21:07:06 +00:00
|
|
|
index 6b550dda2..4e4445d18 100644
|
2016-03-25 09:02:35 +00:00
|
|
|
--- a/src/main/java/org/bukkit/entity/Entity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
2020-01-28 19:43:57 +00:00
|
|
|
@@ -598,4 +598,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
2017-05-15 16:25:20 +00:00
|
|
|
@Override
|
2016-03-25 09:02:35 +00:00
|
|
|
Spigot spigot();
|
2017-05-15 16:25:20 +00:00
|
|
|
// Spigot end
|
2016-03-25 09:02:35 +00:00
|
|
|
+
|
|
|
|
+ // 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
|
|
|
|
+ */
|
2019-03-20 00:28:15 +00:00
|
|
|
+ @Nullable
|
2016-03-25 09:02:35 +00:00
|
|
|
+ Location getOrigin();
|
|
|
|
+ // Paper end
|
|
|
|
}
|
2016-02-29 23:09:49 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
|
2020-04-02 21:07:06 +00:00
|
|
|
index 64f9d3fd8..14cb0d770 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/org/bukkit/entity/FallingBlock.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/FallingBlock.java
|
2019-03-20 00:28:15 +00:00
|
|
|
@@ -54,4 +54,15 @@ public interface FallingBlock extends Entity {
|
2016-02-29 23:09:49 +00:00
|
|
|
* @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
|
2016-03-25 09:02:35 +00:00
|
|
|
+ * @deprecated replaced by {@link Entity#getOrigin()}
|
2016-02-29 23:09:49 +00:00
|
|
|
+ */
|
2016-03-25 09:02:35 +00:00
|
|
|
+ @Deprecated
|
2017-06-03 04:41:05 +00:00
|
|
|
+ default org.bukkit.Location getSourceLoc() {
|
|
|
|
+ return this.getOrigin();
|
|
|
|
+ }
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java
|
2020-04-02 21:07:06 +00:00
|
|
|
index 5a8789324..3022b4a27 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/org/bukkit/entity/TNTPrimed.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/TNTPrimed.java
|
2019-03-20 00:28:15 +00:00
|
|
|
@@ -39,4 +39,15 @@ public interface TNTPrimed extends Explosive {
|
2016-02-29 23:09:49 +00:00
|
|
|
*/
|
2019-03-20 00:28:15 +00:00
|
|
|
@Nullable
|
2016-02-29 23:09:49 +00:00
|
|
|
public Entity getSource();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Gets the source block location of the TNTPrimed
|
|
|
|
+ *
|
|
|
|
+ * @return the source block location the TNTPrimed was spawned from
|
2016-03-25 09:02:35 +00:00
|
|
|
+ * @deprecated replaced by {@link Entity#getOrigin()}
|
2016-02-29 23:09:49 +00:00
|
|
|
+ */
|
2016-03-25 09:02:35 +00:00
|
|
|
+ @Deprecated
|
2017-06-03 04:41:05 +00:00
|
|
|
+ default org.bukkit.Location getSourceLoc() {
|
|
|
|
+ return this.getOrigin();
|
|
|
|
+ }
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
--
|
2020-04-02 21:07:06 +00:00
|
|
|
2.25.1
|
2016-02-29 23:09:49 +00:00
|
|
|
|