Fix casting error.
Add support for CraftBukkit 1.6.1.