Bukkit/CraftBukkit — pull request #750 by Lymia (2012-04-12 09:21:58+00:00)
Title: Fixes TNT implosion.

This fixes a bug where two TNT on the exact same spot will only result in one explosion, a bug that is rather annoying for certain TNT cannon designs. This is caused by a division by zero error when damage on entities by a TNT explosion is calculated. In particular, when their locations are equal, the following code causes d0, d1, and d2 to become NaN. The end result is a TNT's velocity becomes (NaN, NaN, NaN), causing it to basically move out of the game world next tick it runs.
```java
d0 = entity.locX - this.posX;
d1 = entity.locY - this.posY;
d2 = entity.locZ - this.posZ;
double d8 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); // CraftBukkit

d0 /= d8;
d1 /= d8;
d2 /= d8;
```