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
Change perspective of team checking. Fixes BUKKIT-4044

The method's return value was being incorrectly calculated from the
perspective of this.canHurt(that), where it's actually used from the
this.canBeHurtBy(that) perspective.

Remapped by Srg2Source from Bukkit/CraftBukkit@07e33d03cfc9048c0fbc961cc7714e77f2bc0d37