aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0174-Entity-getEntitySpawnReason.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0174-Entity-getEntitySpawnReason.patch')
-rw-r--r--patches/api/0174-Entity-getEntitySpawnReason.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/patches/api/0174-Entity-getEntitySpawnReason.patch b/patches/api/0174-Entity-getEntitySpawnReason.patch
new file mode 100644
index 0000000000..ef8d83b271
--- /dev/null
+++ b/patches/api/0174-Entity-getEntitySpawnReason.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Sun, 24 Mar 2019 00:21:23 -0400
+Subject: [PATCH] Entity#getEntitySpawnReason
+
+Allows you to return the SpawnReason for why an Entity Spawned
+
+Pre existing entities will return NATURAL if it was a non
+persistenting Living Entity, SPAWNER for spawners,
+or DEFAULT since data was not stored.
+
+diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
+index fb3187692878e9686d54c8d022035eba2cea6f25..383844bf956e70cc8a821913d5b2560226d8e2fc 100644
+--- a/src/main/java/org/bukkit/entity/Entity.java
++++ b/src/main/java/org/bukkit/entity/Entity.java
+@@ -754,5 +754,11 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
+ // TODO remove impl here
+ return getLocation().getChunk();
+ }
++
++ /**
++ * @return The {@link org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason} that spawned this entity.
++ */
++ @NotNull
++ org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason();
+ // Paper end
+ }