diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java index d9ac266ba1..e08ad471e0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java @@ -1,8 +1,10 @@ package org.bukkit.craftbukkit.entity; +import net.minecraft.server.EntityLiving; import net.minecraft.server.EntityTNTPrimed; import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.TNTPrimed; @@ -50,4 +52,17 @@ public class CraftTNTPrimed extends CraftEntity implements TNTPrimed { return EntityType.PRIMED_TNT; } + public Entity getSource() { + EntityLiving source = getHandle().getSource(); + + if (source != null) { + Entity bukkitEntity = source.getBukkitEntity(); + + if (bukkitEntity.isValid()) { + return bukkitEntity; + } + } + + return null; + } }