Ported from Bukkit to Forge.