From 66daeda3286703e510f235de2b98ab5859f56b2d Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 21 Mar 2013 12:48:53 -0600 Subject: [PATCH] Add method to get the source of a TNTPrimed. Adds BUKKIT-3815 By: AlphaBlend --- .../java/org/bukkit/entity/TNTPrimed.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/entity/TNTPrimed.java b/paper-api/src/main/java/org/bukkit/entity/TNTPrimed.java index bf4ea5154d..948859e2d5 100644 --- a/paper-api/src/main/java/org/bukkit/entity/TNTPrimed.java +++ b/paper-api/src/main/java/org/bukkit/entity/TNTPrimed.java @@ -12,9 +12,27 @@ public interface TNTPrimed extends Explosive { public void setFuseTicks(int fuseTicks); /** - * Retrieve the number of ticks until the explosion of this TNTPrimed entity + * Retrieve the number of ticks until the explosion of this TNTPrimed + * entity * * @return the number of ticks until this TNTPrimed explodes */ public int getFuseTicks(); + + /** + * Gets the source of this primed TNT. The source is the entity + * responsible for the creation of this primed TNT. + * (I.E. player ignites TNT with flint and steel.) Take note + * that this can be null if there is no suitable source. + * (created by the {@link org.bukkit.World#spawn(Location, Class)} + * method, for example.) + * + * The source will become null if the chunk this primed TNT is in + * is unloaded then reloaded. If the source Entity becomes invalidated + * for any reason, such being removed from the world, the returned value + * will be null. + * + * @return the source of this primed TNT + */ + public Entity getSource(); }