Updated to work with current Bukkit.