PaperMC/Spigot-API-Patches/0007-Entity-Origin-API.patch

66 lines
2.2 KiB
Diff
Raw Normal View History

2016-06-09 05:57:14 +02:00
From 3ce5b4bd388da96e7866319ee200652797a3b74b Mon Sep 17 00:00:00 2001
2016-03-01 00:09:49 +01:00
From: Byteflux <byte@byteflux.net>
Date: Mon, 29 Feb 2016 17:50:31 -0600
Subject: [PATCH] Entity Origin API
2016-03-01 00:09:49 +01:00
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
2016-06-09 05:57:14 +02:00
index aa7cc17..434334a 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
2016-06-09 05:57:14 +02:00
@@ -421,4 +421,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
}
2016-03-01 00:09:49 +01:00
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
index bc56fa2..360e149 100644
2016-03-01 00:09:49 +01:00
--- 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 {
2016-03-01 00:09:49 +01: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
+ * @deprecated replaced by {@link Entity#getOrigin()}
2016-03-01 00:09:49 +01:00
+ */
+ @Deprecated
2016-03-01 00:09:49 +01:00
+ 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
2016-03-01 00:09:49 +01:00
--- 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 {
2016-03-01 00:09:49 +01:00
* @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()}
2016-03-01 00:09:49 +01:00
+ */
+ @Deprecated
2016-03-01 00:09:49 +01:00
+ public org.bukkit.Location getSourceLoc();
}
--
2016-06-04 17:41:04 +02:00
2.8.3
2016-03-01 00:09:49 +01:00