I don't think you need the cast here. OfflinePlayer.getPlayer() returns a player object anyway.