Bukkit/CraftBukkit — pull request #606 by wilsonsd (2011-12-21 01:01:24+00:00)
Title: Check min and max height when calculating explosion. BUKKIT-232 fix

Issue BUKKIT-232: When a TNT block explodes near the maximum world
height, the explosion wraps around and destroys blocks at the bottom
of the world (including bedrock blocks).

Reason for bug: In Explosion.a, line 182, when the height in the call
to CraftWorld.getBlockAt is above the maximum height, getBlockAt
wraps the height around and returns a block at the bottom of the
world. This happens because getBlockAt takes the height y, and gets
the block at height (y & 0x7F). If y is greater than 127, this &
operation wraps the height around.

Fix: when calculating which blocks are affected by an explosion, check
the height of affected blocks to make sure they aren't above or below
allowed heights.