Use correct method for getting player's team. Fixes BUKKIT-4050

The method getTeam gets the team from name of, as opposed to getting the
team a player belongs to.

This also addresses BUKKIT-4002 and partially BUKKIT-4044

Remapped by Srg2Source from Bukkit/CraftBukkit@28a404acfc4112b2e2ed6fca361e7ebc36e28d53